Add capability to list all permissions #239
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I should warn I'm fairly new to the concept of promises (usually just use callbacks).
I could use some assistance with this as I'm not sure how the promises are used when they come out of the service.
If I do a PermissionService.getAllPermissions.then(function(result) {console.log(result)}) on the first ok.then call, it prints the correct information, but I am not sure if that is the desired output. So I added the 2nd ok.then on top of it to only return the relative information (model the permission is on, the role associated, and action allowed). I for some reason can't get it to return the collection in my console when I do PermissionService.getAllPermissions, and I'm not sure what I'm doing wrong.
This is a pull request because I feel there should be a way for admins to see what permissions have been granted to what roles easily.