You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Allen Gilliland <al...@sun.com> on 2007/08/01 21:10:02 UTC

Re: New proposals for externalizing Roller user/permissions management

Dave,

I took a quick look through this and I think it's looking pretty good. 
I like the idea of using the java security stuff as the base for the 
permissions, that sounds very clean and extensible.

I like how the checkPermission(perm, user) method is very generic and 
simple, that seems like a very nice design.  So to take that design one 
step further, is there any reason why we really need to separate out the 
concept of roles vs. permissions any more?  Is there any reason to keep 
those separate in the data model any more?  i.e. what if we just had ...

public void grantPermission(RollerPermission perm, User user);

which would be a logic counterpart to the checkPermission(perm, user) 
method and would probably work similar to ...

   if(perm instanceof GlobalPermission) {
     // apply the user role
   } else if(perm instanceof WeblogPermission) {
     // grant weblog permission
   } else {
     // probably bad input
   }

this would further simplify the methods you mention because we would no 
longer need any of the grant/revoke methods, and instead of having get 
methods for roles vs. permissions we would just have getPermissions() 
methods.  would that work?

i also like that you've redone the permission table, which seems to 
simplify things as well, but can we carry that on from my suggestion 
above and just store all permission data in that table, including roles 
and weblog permissions?  would that work?

this way if you add all of that up we are greatly reducing the security 
framework into these methods ...

public boolean checkPermission(RollerPermission perm, User user);
public void grantPermission(RollerPermission perm, User user);
public void revokePermission(RollerPermission perm, User user);
public List<RollerPermission> getPermissions(User user);

is that feasible?

-- Allen


Dave wrote:
> I have withdrawn my two Roller 4.1 user/perms management proposals and
> replaced them with one proposal that incorporates feedback from Elliot
> and Allen:
> 
> " Proposal Externalize User And Permissions Management"
> http://tinyurl.com/28br55
> 
> Major changes
> - Removed User Repository API
> - Removed User Permssions API
> - Defined single consistent permssions system exposed via UserManager
> - Added details on specific changes to be made to implement the system
> 
> Comments and suggestions for improvement are more than welcome.
> 
> Thanks,
> - Dave

Re: New proposals for externalizing Roller user/permissions management

Posted by Dave <sn...@gmail.com>.
On 8/1/07, Allen Gilliland <al...@sun.com> wrote:
> I took a quick look through this and I think it's looking pretty good.
> I like the idea of using the java security stuff as the base for the
> permissions, that sounds very clean and extensible.

Thanks for the careful review. I need all the help I can get on this one.


> I like how the checkPermission(perm, user) method is very generic and
> simple, that seems like a very nice design.  So to take that design one
> step further, is there any reason why we really need to separate out the
> concept of roles vs. permissions any more?  Is there any reason to keep
> those separate in the data model any more?  i.e. what if we just had ...
>
> public void grantPermission(RollerPermission perm, User user);
>
> which would be a logic counterpart to the checkPermission(perm, user)
> method and would probably work similar to ...
>
>    if(perm instanceof GlobalPermission) {
>      // apply the user role
>    } else if(perm instanceof WeblogPermission) {
>      // grant weblog permission
>    } else {
>      // probably bad input
>    }
>
> this would further simplify the methods you mention because we would no
> longer need any of the grant/revoke methods, and instead of having get
> methods for roles vs. permissions we would just have getPermissions()
> methods.  would that work?
>
> i also like that you've redone the permission table, which seems to
> simplify things as well, but can we carry that on from my suggestion
> above and just store all permission data in that table, including roles
> and weblog permissions?  would that work?
>
> this way if you add all of that up we are greatly reducing the security
> framework into these methods ...
>
> public boolean checkPermission(RollerPermission perm, User user);
> public void grantPermission(RollerPermission perm, User user);
> public void revokePermission(RollerPermission perm, User user);
> public List<RollerPermission> getPermissions(User user);
>
> is that feasible?

Possibly. I am somewhat reluctant to remove the notion of Roles
because I believe they give us a way to hook into and take advantage
of standard Java EE security. Here are some reasons to keep the notion
of Roles:

* Java EE supports roles and provides an API for creating them (JACC).
It is not very well supported yet, but it's coming soon to a container
near you. Standard permissions support may be a long time coming.

* App servers can/do provide infrastructure for:
     - mapping external groups (e.g. LDAP groups) to roles
     - automatically placing users into roles based on realms

* Roles are a way to imply specific permissions

Another reason I'm reluctant is that I need to externalize user
management so Roller can be easily integrated with other systems. Some
of those systems don't support permissions yet, but they do support
Roles. My user manager may have to take the common denominator
approach of dealing only with Roles and I'll need the flexibility to
use Roles to imply Permissions.

- Dave

Re: New proposals for externalizing Roller user/permissions management

Posted by Elliot Lee <el...@lulu.com>.
Allen Gilliland wrote:
> i also like that you've redone the permission table, which seems to 
> simplify things as well, but can we carry that on from my suggestion 
> above and just store all permission data in that table, including 
> roles and weblog permissions?  would that work?
>
> this way if you add all of that up we are greatly reducing the 
> security framework into these methods ...
>
> public boolean checkPermission(RollerPermission perm, User user);
> public void grantPermission(RollerPermission perm, User user);
> public void revokePermission(RollerPermission perm, User user);
> public List<RollerPermission> getPermissions(User user);
>
> is that feasible?

Hi,

Just a couple of notes:
    . I've discovered that the Lulu equivalent of checkPermission() has 
a big weakness: when permission is denied, there's no way to indicate to 
the user why. It'd be nice to think how the authz framework could 
indicate "server is down" versus "the administrator thinks you are a 
schmo", so that the user has more information beyond being told "You are 
not allowed to do that."
    . Also note that the possible outcome of permission checking could 
concievably go beyond "allowed" or denied". For example, if a user is 
trying to post a comment to a blog post, "requires_moderator_approval" 
is a valid checkPermission() result in addition to "allowed" and 
"denied". So it might make sense to return a PermissionResultCode 
instead of just a bool. I can't think of any other permissions checking 
result codes that might be needed beyond these three, but it's worth 
allowing for.
    . grantPermission & revokePermission may be combined into one 
routine: setPermission(RollerPermission perm, User user, 
PermissionResultCode result_code). If the authz framework needs to 
execute actions when a permissions is changed, it can do that work itself.
    . getPermissions() (and to some extent grantPermission & 
revokePermission) may not work in situations where the result of 
checkPermission() is a calculated result rather than a stored value. 
Just want to clarify whether grant/revoke/getPermissions will be called 
except in the Roller UI for editing permissions...

Best,
-- Elliot