Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Define new permissions classes using the java.security.Permission class as the base class.

Class RollerPermission extends java.security.Permission

  • Common base class for all Roller permissions

Class GlobalPermission extends RollerPermission defines global actions:

...

Here are the new properties:

Code Block

role.actions.anonymous=comment

...


role.actions.editor=login,comment,createWeblog

...


role.actions.admin=login,comment,createWeblog,admin

...


For example, if you wanted to prevent users from creating new weblogs you would put this in your roller-custom.properties file: role.actons.editor=login,comment

...

Code Block
public boolean checkPermission(RollerPermission perm, User user);

For example, if you want to check to see if a user has can post a weblog entry, you would do this:

Code Block

WeblogPermssion desiredPerm = new WeblogPermission(weblog, "post");
boolean allowed = userManager.checkPermssion(desiredPerm, user);

Next, we need to provide a way for the Roller front-end to grant and revoke roles because roles imply global permissions.

...