-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent the last manager from removing manager role #557
prevent the last manager from removing manager role #557
Conversation
Signed-off-by: Prakash P S <[email protected]>
Signed-off-by: Prakash P S <[email protected]>
Signed-off-by: Prakash P S <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close, see comment on permission_lib.js
{ | ||
let admin_count = 0; | ||
for (let user in settings_doc.access_list) { | ||
if (user.roles.includes('manager')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user
isn't what you think it is, its just the key of the access_list
object, so its just a string. to get to the properies of that user, it should be:
for (let id in settings_doc.access_list) {
let user = settings_doc.access_list[id];
if (user && user.roles && user.roles.includes('manager')) {
admin_count = admin_count + 1;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dshuffma-ibm , I have updated the code as mentioned
Signed-off-by: Prakash P S <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Type of change