09-02-2009, 08:09 PM
|
#9 (permalink)
|
|
The Contributor
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
|
Quote:
Originally Posted by Tanax
Because I think that will be the best solution for what I want to accomplish.
What if I have a feature called "blog", that would go into the resource "blog". Then also, I have a page called "blog", that would also be a resource "blog" - but wait, that won't work.. It already exists!
And lastly, how do I store the permissions set by the owner of the blog into the "blog"(as used in $perm->canSee() function which checks if the viewing user can see the "blog" in this case, based on the permission set by the owner)? I can't store it as a resource.. because there are already 2 other "blog" resources..
That is, in my opinion, a flawed system. But maybe I've misunderstood how to use this..
Thanks! I'll check it out!
|
Yes this is true,
But you would only need to setup the resources in a different named manner.
For your blog example
feature_blog
page_blog
Each blog "owner would have say"
23_blog - 23 being their userId
Which then permissions can be set, it may seem a bit more complicated but it would be fairly the same as a naming convention that can be easily modified to suit your needs rather than having multiple methods that perform the same logic, which once your code starts scaling could lead to future bugs.
A few more examples would be
" 23_blog_post_415_comment_edit" -> Resource:: UserId -> 23 Blog PostId -> 415 Comment editing
" page_aboutme_view" -> Resource:: About me page viewing
" widget_25_15_view" -> Resource:: WidgetId->25 UserId -> 15 Viewing
|
|
|
|