Skip to content

ML Kibana privileges opt-in using kibana.yml#40073

Closed
kobelb wants to merge 13 commits intoelastic:masterfrom
kobelb:poc/ml-opt-in
Closed

ML Kibana privileges opt-in using kibana.yml#40073
kobelb wants to merge 13 commits intoelastic:masterfrom
kobelb:poc/ml-opt-in

Conversation

@kobelb
Copy link
Copy Markdown
Contributor

@kobelb kobelb commented Jul 1, 2019

No description provided.

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@kobelb
Copy link
Copy Markdown
Contributor Author

kobelb commented Jul 9, 2019

@legrego you mind giving the changes I made to the role management screens a review? I'm trying to determine whether we can avoid addressing #38101 as part of these changes.

const isAllowedCustomizations =
allowedPrivileges[record.spacesIndex].base.privileges.length > 1;
const featureEntries = Object.values(allowedPrivileges[record.spacesIndex].feature);
const isAllowedCustomizations = featureEntries.some(entry => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, if I gave the user global all and then a custom set of privileges at a space granting access to ML, it'd show "All" for the space specific privileges:

all

return (
<PrivilegeDisplay
explanation={basePrivilege}
explanation={showCustomize ? undefined : basePrivilege}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, if I gave the user global all and then a custom set of privileges at a space granting access to ML, it'd show "Custom" with a lock even though it's truly just Custom:

custom-lock

if (
hasAssignedFeaturePrivileges(form) ||
explanation.actualPrivilege === NO_PRIVILEGE_VALUE ||
form.base.length === 0 ||
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, if I gave the user global all and then created a new entry for the default space, the drop-down would default to "All" because this was the "actual privilege" which it inherited globally. Where-as elsewhere we default to "Custom" whenever we can:

custom

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@legrego
Copy link
Copy Markdown
Member

legrego commented Jul 10, 2019

ACK, will look today

@legrego legrego self-requested a review July 10, 2019 10:25
Copy link
Copy Markdown
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem reasonable enough to avoid rearchitecting the privilege calculator.

We're changing an assumption with this PR -- before, features could have either reserved or regular privileges, but never both. Now we have features with both..this is obviously expected as part of this effort, but I'm trying to think of any other places where this assumption is important...I can't think of anything right now, but I'll update if I come across anything else.

@kobelb
Copy link
Copy Markdown
Contributor Author

kobelb commented Jul 10, 2019

Thanks @legrego, I'm gonna pull these changes out into another PR and add the necessary tests.

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@kobelb kobelb closed this Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants