Skip to content

Commit

Permalink
Filtering out non-default resource Kibana privileges (elastic#19321)
Browse files Browse the repository at this point in the history
  • Loading branch information
kobelb authored and legrego committed Jun 22, 2018
1 parent 075784e commit 9585958
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x-pack/plugins/security/public/views/management/edit_role.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const getKibanaPrivileges = (kibanaApplicationPrivilege, role, application) => {
return kibanaPrivileges;
}

const applications = role.applications.filter(x => x.application === application);
// we're filtering out privileges for non-default resources as well incase
// the roles were created in a future version
const applications = role.applications
.filter(x => x.application === application && x.application.resources.all(r => r === DEFAULT_RESOURCE));

const assigned = _.uniq(_.flatten(_.pluck(applications, 'privileges')));
assigned.forEach(a => {
Expand Down

0 comments on commit 9585958

Please sign in to comment.