Hi,<br>
<br>
I don't think you can achieve that by Catalyst::Plugin::Authorization but please correct me if I am wrong.<br>
<br>
On a side note though, I also had an idea that is similar to yours some time ago, but I scrapped it because the number of records in<br>
users_pages_roles tables will increase exponentially as the number of users and pages increase.<br>
I wonder how the sharing function is implemented in Google Docs though.<br>
<br>
Sindharta<br>
<br>
<b>jakac <jakac@iprom.si></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <font face="Helvetica, Arial, sans-serif">Hello!<br>
<br>
I am new to Catalyst and I am developing my first web application using this really<br>
great framework. I really like the way Catalyst allows me to build my application but<br>
now I have a problem which I can not resolve by myself.<br>
<br>
I studied the tutorial and I understand the whole concept of "role based" authorization<br>
where we have three tables:<br>
<br>
- users (list of users with primary key user_id)<br>
- roles (list of roles with primary key role_id)<br>
- users_roles (with user_id - role_id relations)<br>
<br>
but for my application I need a bit more advanced system than that because every<br>
user has also multiple pages and different roles for each page (he can edit some,<br>
only view the others etc.). One user has different permissions for each of the pages and<br>
also more users have access (and different permissions) to the same page.<br>
So I need 4 tables:<br>
<br>
</font><font face="Helvetica, Arial, sans-serif">- users (list of users with primary key user_id)<br>
- roles (list of roles with primary key role_id)<br>
</font><font face="Helvetica, Arial, sans-serif">- pages (list of pages with primary key page_id)</font><br>
<font face="Helvetica, Arial, sans-serif">- users_pages_roles (with user_id - page_id - role_id relations)<br>
<br>
e.g.:<br>
user1 | page1 | edit<br>
</font><font face="Helvetica, Arial, sans-serif">user1 | page2 | edit<br>
user2 | page2 | view<br>
</font><font face="Helvetica, Arial, sans-serif">user3 | page1 | edit<br>
</font><font face="Helvetica, Arial, sans-serif">user3 | page2 | view</font><br>
<font face="Helvetica, Arial, sans-serif">etc.<br>
<br>
How can I make this kind of authorization using Catalyst? How to build a model<br>
and configure "roles" plugin?<br>
<br>
Also with simple role based system I can check if user has permission to use that part<br>
of application using:<br>
</font> <pre>$c->assert_user_roles( qw/rolename/ );</pre> <font face="Helvetica, Arial, sans-serif">What about with this kind of "advanced" authorization?</font><br>
<br>
Thank you all!<br>
<br>
JakaC.<br>
<br>
_______________________________________________<br>
List: Catalyst@lists.scsys.co.uk<br>
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
Dev site: http://dev.catalyst.perl.org/<br>
</blockquote><br>
<div style="line-height: 0; width: 0; height: 5px; clear: both;"> </div>
<p> 
<hr size=1><a href=http://pr.mail.yahoo.co.jp/ganbare-nippon/ target="new">GANBARE! NIPPON! Win your ticket to Olympic Games 2008.</a><br>