Skip to content

Commit

Permalink
[ML] Adding missing default privilege values (#21131) (#21136)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic authored Jul 24, 2018
1 parent 082ed45 commit 5452c30
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions x-pack/plugins/ml/public/privilege/get_privileges.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ export function getPrivileges() {
canUpdateJob: false,
canUpdateDatafeed: false,
canPreviewDatafeed: false,
canGetCalendars: false,
canCreateCalendar: false,
canDeleteCalendar: false,
canGetFilters: false,
canCreateFilter: false,
canDeleteFilter: false,
};

return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -58,9 +62,8 @@ export function getPrivileges() {

ml.checkPrivilege(priv)
.then((resp) => {

// if security has been disabled, securityDisabled is returned from the endpoint
// therefore set all privileges to true
// if security has been disabled, securityDisabled is returned from the endpoint
// therefore set all privileges to true
if (resp.securityDisabled) {
Object.keys(privileges).forEach(k => privileges[k] = true);
} else {
Expand Down

0 comments on commit 5452c30

Please sign in to comment.