You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your question is kind of unclear, as Model View Controller doesn't really apply in this ACL context. I'm not using the middleware, so no ideas on how it would work there, but you can just make one resource for every article.
It looks like the pattern for max granularity is to:
give every object (i.e. a document in a MongoDB collection) its own resource (i.e. article-<id>)
give every user their own role (i.e. user-<id>)
create roles corresponding to each perm level for each resource (i.e. article-<id>/show, article-<id>/edit, etc.), such that role article-id/<show> has permission show on article-<id> while article-id/<edit> could have permissions show and read on article-<id>. That way you can get hierarchical permission levels with fewer operations when granting permission to a user.
grant a user permission on a resource by making their personal role a child of the given resource permission role (i.e. user-<id> becomes a child of article-<id>/show)
Not sure how it scales, but that provides the most granularity across the application. Note that I'm not a contributor to this library, just a developer in the process of implementing the pattern as described. Would love to hear from @manast about any issues he'd foresee as this pattern scales!
Activity
[-]Non MVC resources ?[/-][+]Not MVC resources ?[/+]john-osullivan commentedon Sep 22, 2017
Your question is kind of unclear, as Model View Controller doesn't really apply in this ACL context. I'm not using the middleware, so no ideas on how it would work there, but you can just make one resource for every article.
It looks like the pattern for max granularity is to:
article-<id>)user-<id>)article-<id>/show,article-<id>/edit, etc.), such that rolearticle-id/<show>has permissionshowonarticle-<id>whilearticle-id/<edit>could have permissionsshowandreadonarticle-<id>. That way you can get hierarchical permission levels with fewer operations when granting permission to a user.user-<id>becomes a child ofarticle-<id>/show)Not sure how it scales, but that provides the most granularity across the application. Note that I'm not a contributor to this library, just a developer in the process of implementing the pattern as described. Would love to hear from @manast about any issues he'd foresee as this pattern scales!