[ML] Adding missing default privilege values (#21131)

This commit is contained in:
James Gowdy 2018-07-24 13:02:51 +01:00 committed by GitHub
parent 33bad59e1c
commit 5cb22806da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) => {
@ -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 {