-
Notifications
You must be signed in to change notification settings - Fork 140
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
$rbac->Users->AllRoles() throws error if no parameter is passed #6
Comments
ok Notice: This message is digitally signed, its source and integrity are verifiable. On Mordad 31, 1392, at 4:10 AM, Jesse Burns notifications@github.com wrote:
|
As per our discussion in Issue #2, I propose that we make $UserID mandatory and create/throw an Exception if $UserID is null. |
i belive allRoles should return all roles (not those of the user), check again. if its what you think the soution is right Notice: This message is digitally signed, its source and integrity are verifiable. On Shahrivar 1, 1392, at 8:13 AM, Jesse Burns notifications@github.com wrote:
|
This method's intent/purpose is to return roles assigned to a user. I have one concern regarding returning an object for this method. In either case we will be returning data for multiple items (every roll assigned to a user). I think we should probably stick with the array, because if we return an object it will still contain multiple items and in essence still be a multidimensional array. I think if we were to return a single entity then an object would be ideal, but I'm not too sure about multiple entities. That sounds like the job and purpose of an array. Let me know what you think. P.S. Your response sparked an idea. I've created Issue #9 as a proposal. |
hmm Notice: This message is digitally signed, its source and integrity are verifiable. On Shahrivar 1, 1392, at 1:55 PM, Jesse Burns notifications@github.com wrote:
|
…ge for further details. Resolves Issue #2: * I have removed all references of 'jf::CurrentUser()', made $UserID mandatory, and have added an exception if the $UserID is not provided. This exception will add flexibility to PhpRbac's testability and error handling capabilities. * I have updated all affected Unit Tests associated with these changes, while adding Unit Tests as needed Resolves Issue #3: * Along with the changes from Issue #2, I have removed the references to jb::run and added the 403 header along with a die which displays a 'Forbidden' message if the check in $rbac->enforce fails * If the check in $rbac->enforce is successful, $rbac->enforce will return true for testing and error handling purposes Resolves #6: * UserID is now mandatory and will throw an exception if the parameter is empty
I've addressed this Issue in commit aebafee Please review and close Issue if everything looks good to you. |
The comments state,
yet a php error is thrown if no parameters are supplied.
Proposed fix:
Old
New
The text was updated successfully, but these errors were encountered: