Exemplo n.º 1
0
 /**
  * Removes a sub role from this role.
  *
  * @param role The role to remove.
  */
 @Override
 public void removeRole(Role role) {
   if (role.isMasterRole()) {
     throw new APSSimpleUserServiceException(
         "Bad role '" + role.getId() + "'! A master role cannot be added to another role!");
   }
   if (this.roles != null) {
     this.roles.remove(role);
   }
 }
Exemplo n.º 2
0
 /**
  * Adds a sub role to this role.
  *
  * @param role The role to add.
  */
 @Override
 public void addRole(Role role) {
   if (role.isMasterRole()) {
     throw new APSSimpleUserServiceException(
         "Bad role '" + role.getId() + "'! A master role cannot be added to another role!");
   }
   if (this.roles == null) {
     this.roles = new LinkedList<RoleEntity>();
   }
   this.roles.add((RoleEntity) role);
 }