[jboss-jira] [JBoss JIRA] Commented: (JBPORTAL-2283) a method to get admin roles in RoleModule

Luca Stancapiano (JIRA) jira-events at lists.jboss.org
Sun Feb 15 05:43:44 EST 2009


    [ https://jira.jboss.org/jira/browse/JBPORTAL-2283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12452701#action_12452701 ] 

Luca Stancapiano commented on JBPORTAL-2283:
--------------------------------------------

I added theese methods to get admin roles:

org.jboss.portal.identity.RoleModule :

   /**
    * Get all the administrator roles
    *
    * @return the role names
    */
   Set<String> getAdminRoles() throws IdentityException;


org.jboss.portal.identity.service.RoleModuleService :


   public Set<String> getAdminRoles() throws IdentityException
   {
      String defaultRoles = getIdentityConfiguration().getValue(IdentityConfiguration.ROLE_DEFAULT_ADMIN_ROLE);
      if (defaultRoles == null)
      {
         throw new IdentityException("Configuration option missing: " + IdentityConfiguration.ROLE_DEFAULT_ADMIN_ROLE);   
      }
      return Tools.toSet(defaultRoles.split(" "));
   }


about Admin Users, the application could write a method as:

   public void getAdminUsers() throws Exception {
      Set<String> allUsers = new TreeSet();
      Set<String> adminRoles = roleModule.getAdminRoles();
      for (String role : adminRoles) {
         Set users =  membershipModule.getUsers(roleModule.findRoleByName(role));
         allUsers.addAll(users);
      }
   }

> a method to get admin roles in RoleModule
> -----------------------------------------
>
>                 Key: JBPORTAL-2283
>                 URL: https://jira.jboss.org/jira/browse/JBPORTAL-2283
>             Project: JBoss Portal
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: Portal Identity
>    Affects Versions: 2.7.0 Final
>         Environment: jboss portal 2.7.1, module identity from http://anonsvn.jboss.org/repos/portal/modules/identity/tags/JBP_IDENTITY_1_0_5
>            Reporter: Luca Stancapiano
>            Assignee: Boleslaw Dawidowicz
>             Fix For: 2.7.0 Final
>
>
> what do you think about a findAdminRoles() method into org.jboss.portal.identity.RoleModule interface?
> Set findAdminRoles() throws IdentityException;
> it could avoid to write a properties file for an external portlet, so you don't duplicate roles definition in your projects. JBoss Feeds for example needs of a similar method to do authorization controls on a logged user. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list