-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Role/Permission] Configuration tool (2 of 4) #3538
Conversation
echo "The permissions in the database are:\n\n"; | ||
prettyPrint($permissions); | ||
exit(3); | ||
case "rebuildRoles": |
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.
exit code other than 0 are normally for error or abnormal ending. When there is no error or problem, exit code is normally 0.
Could also use a single exit() call with a variable.
) | ||
); | ||
|
||
echo "\n$permission was added to the $role category.\n\n"; |
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.
"category" should be "role" as other messages
* if false, removes the role from the user | ||
* | ||
* @return void | ||
*/ |
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.
I don't see why a "addPermission" function would remove a role from a user.
This portion should be in a "removeRole" function otherwise user might loose some permissions
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.
if u add a permission to a rome, you have 2 choices,
- give that permission to all the users with that role
- remove the role from all the users who dont have that permission
that decision is left to the administrators running the patch
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.
Ok, now I understand, maybe I am slow, or maybe the text was not clear.
); | ||
|
||
echo "\n$permission was removed from the $role category.\n"; | ||
|
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.
again "category" instead of "role"
return false; | ||
} | ||
return true; | ||
} |
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.
multiple return
Closing until #3537 goes in, until then it's going to need continual rebasing and just make it look like our PRs aren't being worked on. |
This adds the Role infrastructure to LORIS. This is one of 4 PRs which will ultimately result in assigning roles to users. each role has affiliated permissions and automatically checks the proper permission when selected. This change will be mainly visible in the user_accounts module.
PART 2: Add tool used to configure the role/permission relationships as well as populate the data in the right table given an existing populated database.
in order to test, the following SQL inserts can be used:
Original PR by @taracampbell : #2642
Updated/Standardized/DAO full version : ridz1208#9