-
Notifications
You must be signed in to change notification settings - Fork 11
User permissions #33
Comments
Could you give an example of this and how it could be used? |
Now you have roles and permissions and relation between them. For example: admin can add, edit, delete users, and so on. Some projects need a little bit more advanced permissions handling on per user basis. For example:
So permissions per user, and not per role... |
Don't see much use for this as its already possible by doing the following: User with ID 5 have a role that has permission to add, edit, delete articles So, unsure. You could maybe make a pull request and I could review it as whether its beneficial to have this. Thanks |
Yes but if you have a heavy user driven backend, that lots of users are using and you need to restrict lots of things for some users you end up with N different roles, whereas you would need only couple of roles for access and then per user restriction on permissions... |
That's true.. convinced and +1 for this.. will work on it for 2.1 Thanks for the insight |
Great, thanks for the info, looking forward on it. Take care. |
hello
|
Hi a7madgamal. Thanks on your input. I don't see any special reason having another layer (groups), when you already have roles which also serve as a collection of users? What's the benefit of having these groups? |
@a7madgamal @PrimozRome Also don't see the need for this when you can just use roles to represent groups. Any reason for this? |
@PrimozRome Any ideas on how to go about adding permission based on users also? |
Yeaj I was thinking about how this should be done. Found a lot of resources including one very interesting article: http://lostechies.com/derickbailey/2011/05/24/dont-do-role-based-authorization-checks-do-activity-based-checks/. He completely dismisses the role-based authorization/permission system with some good examples! You can also check some comments bellow the article, you will get some nice input on this. But if you follow above article you would end up without roles completely and end up only with users, permissions and users_permissions... If I understand it right and I guess it makes sense. More ACL resources and design coments can be found here: http://stackoverflow.com/questions/4415663/implementing-acl-for-my-php-application. The real question I guess here is the one being asked in above linked article. Do we really need ROLE based ACL at all? The problem of ROLE based ACL is that you eventually end up with tens and hundreds of roles, which becomes impossible to sustain. I have used the role based authorization since ever and I have end up so many roles I can not even count. I think better solution is to have User based ACL, so like users, permissions, and users_permissions... But then I guess I am not sure how you say this user is just an user, or this user is user and admin. Then ADMIN is only another permission which you grant to user? Maybe you would leave roles in Wardem, and use them to authorize user for certain parts of the app. Like normal user, admin, moderator, ... And re-implement permissions which would be assigned to each individual user, instead to each role. Then you would have users_permissions instead of roles_permissions, everything else would almost stay the same... |
Hi dre, did you have any thoughts on this? |
@PrimozRome |
I am also very busy with my ongoing projects currently, but I will try to look into this and see If I am able to do it. Do you think it would make sense to implement it like this:
Then you can decide whether you need to use one of them or both? |
Yes I think that makes the most sense, to have both for now. |
I now have working implementation on users_permissions, but am still testing it. So far so good, but my implementation is only on users_permissions and I have removed roles_permissions ... Actually it's pretty simple:
|
I think this can be implemented this way... This way we can use user-permission as a specify permission for a user, and users-permissions table will have only permission that the user needs. If you we remove roles-permissions, you'll have to add a big list of permissions to an user when it is created... |
Is there any plan to extend warden to have permission based on users and not only roles as in current implementation?
The text was updated successfully, but these errors were encountered: