<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-2022-JP"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hello!<br>
<br>
Yes, I am also pretty sure that I will not be able to achieve something
like this using<br>
one of the common plugins. So I was wondering if anybody has a simple
solution<br>
for this kind of problem?<br>
<br>
Since my application will be used by a limited number of users (about
100-200) I am<br>
not afraid that </font>
users_pages_roles table would grow too big but I still need some<br>
kind of solution..<br>
<br>
Thanx.<br>
<br>
<a class="moz-txt-link-abbreviated"
 href="mailto:sindharta_tanuwijaya@yahoo.co.jp">sindharta_tanuwijaya@yahoo.co.jp</a>
wrote:
<blockquote
 cite="mid:20080520040837.5732.qmail@web3114.mail.kcd.yahoo.co.jp"
 type="cite">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 <a class="moz-txt-link-rfc2396E"
 href="mailto:jakac@iprom.si">&lt;jakac@iprom.si&gt;</a></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-&gt;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: <a class="moz-txt-link-abbreviated"
 href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a class="moz-txt-link-freetext"
 href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive:
    <a class="moz-txt-link-freetext"
 href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a class="moz-txt-link-freetext"
 href="http://dev.catalyst.perl.org/">http://dev.catalyst.perl.org/</a><br>
  </blockquote>
  <br>
  <div style="line-height: 0pt; width: 0pt; height: 5px; clear: both;">&nbsp;</div>
  <p> </p>
  <hr size="1"><a moz-do-not-send="true"
 href="http://pr.mail.yahoo.co.jp/ganbare-nippon/" target="new">GANBARE!
NIPPON! Win your ticket to Olympic Games 2008.</a><br>
  <pre wrap=""><hr size="4" width="90%">
_______________________________________________
List: <a class="moz-txt-link-abbreviated"
 href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a>
Listinfo: <a class="moz-txt-link-freetext"
 href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a>
Searchable archive: <a class="moz-txt-link-freetext"
 href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a>
Dev site: <a class="moz-txt-link-freetext"
 href="http://dev.catalyst.perl.org/">http://dev.catalyst.perl.org/</a>
  </pre>
</blockquote>
</body>
</html>