mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
## Summary Currently, our `requiredPrivileges` structure supports `allRequired` and `anyRequired` for defining authorization logic. However, there is [a need to support](https://github.com/elastic/kibana/pull/205335#issuecomment-2569275302) more complex scenarios as `(privilege1 AND privilege2) OR (privilege3 AND privilege4)` To achieve `anyRequired` has been extended to allow defining multiple AND conditions evaluated with OR logic: ```ts security: { authz: { requiredPrivileges: [{ anyRequired: [ { allOf: ['privilege1', 'privilege2'] }, { allOf: ['privilege3', 'privilege4'] } ] } ] } } ``` `allRequired` now also supports scenarios `(privilege1 OR privilege2) AND (privilege3 OR privilege4)` ```ts security: { authz: { requiredPrivileges: [{ allRequired: [ { anyOf: ['privilege1', 'privilege2'] }, { anyOf: ['privilege3', 'privilege4'] } ] } ] } } ``` > [!IMPORTANT] > We expect to have unique privileges in `anyOf` or `allOf` conditions, assuming that most complex conditions can be simplified by boolean algebra laws (OR/AND distributive etc). ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) __Closes: https://github.com/elastic/kibana/issues/210977__ --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
assets | ||
contributing | ||
getting_started | ||
key_concepts | ||
lens | ||
operations | ||
shared_ux | ||
tutorials | ||
api_welcome.mdx | ||
kibana_server_core_components.mdx | ||
nav-kibana-dev.docnav.json |