-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Roles -> Permissions #42
Comments
Hi @sclausen, Thanks for the suggestion. I think you can do this with the It is a fork by another user of I'll try to get in touch with the author and see if there's interest in remerging back into |
I just run into Meteor and I'm wondering what should I choose between your package or the How is your package better than |
Both packages let you assign permissions to users. The authorization package is based off an earlier version of this package and adds the ability to "nest" permissions in a hierarchy. Not sure if it can handle trees of an arbitrary depth or just two levels. So you could have an "admin" permission and nest permissions under it like "manage-users", "view-secrets", etc. then assign the "admin" permission to a user and they auto-get the others. At least that's my understanding. If that sounds useful for your use case and you don't need the more recent updates to this package (see commit history since fork) then go for authorization. If you need the latest roles features, you can accomplish something similar with its flat hierarchy by checking for multiple roles:
But you'll have to update those checks if you want to change the default of what 'admin' means so it's not quite as convenient. A word of caution, I've found that using a permission hierarchy sounds nice in the beginning but it tends to break down in real life. There's always exceptions and it causes confusion if users are managing any of that themselves. If it's more of an internal use only thing then you should be fine.
|
Okay, thanks for the answer, I mostly wanted to know the differences between both, I prefer use something maintained anyway. I don't need nested permissions neither. |
I would also agree that some form of hierarchical roles/permissions would be a great feature to have. |
Hi, this isn't a real issue, its more an idea. Wouldn't it be awesome, if you could attach permissions to roles and check them on server/client like
Roles.isPermitted(loggedInUser, "admin:users:write");
instead ofRoles.userIsInRole(loggedInUser, ['user-manager'])
. I would suggest a permission system like Apache Shiro.This way, you could manage what e.g. the admin-user or user-manager can do apart of the role.
Therefore you can change the meaning of being in a role and don't have to change every users roles if features of your app change in future.
The text was updated successfully, but these errors were encountered: