nl.gx.webmanager.authorization.impl
Class RoleImpl

java.lang.Object
  extended by nl.gx.webmanager.authorization.impl.HtmlObjectWrapperImpl
      extended by nl.gx.webmanager.authorization.impl.RoleImpl
All Implemented Interfaces:
HtmlObjectWrapper, Role

public class RoleImpl
extends HtmlObjectWrapperImpl
implements Role

Implementation of the Role interface. This implementation wraps the GroupObject siteworks objecttype.

Author:
Arjan Seijkens/Ivo Ladage

Field Summary
 
Fields inherited from class nl.gx.webmanager.authorization.impl.HtmlObjectWrapperImpl
id
 
Constructor Summary
RoleImpl()
          Default constructor for a Role implementation instance.
RoleImpl(java.lang.String id)
          Constructor for a Role implementation taking the id of the siteworks object it wraps as a parameter.
 
Method Summary
 boolean checkAccess(java.lang.String permissionValue)
          Returns true if this role has access to given permission.
 void copyPermissionsFromGroup(java.lang.String permissionGroupId)
           
 Permission[] getAllPermissions()
          Returns all permissions assigned to this role, directly by a permission group or by inheritence of roles.
 boolean getAllWebInitiatives()
          Return if this role is available on all web initiatives
 Permission[] getGroupPermissions()
          This method returns all permissions that are assigned indirectly by assiging permission groups to the role.
 Permission[] getInheritedPermissions()
          This method returns all permissions that were inherited from from a superrole.
 java.lang.String getName()
          Returns the name of the role.
 java.lang.String[] getPageSectionLabels()
          Return all page section labels assigned to this role
 PermissionGroup[] getPermissionGroups()
          Returns all PermissionGroup object instances assigned to the role.
 Permission[] getPermissions()
          This method returns only the permissions that are assigned to this role explicitely.
 Role[] getSubRoles()
          Returns all Role object instances that are a subrole of this role.
 Role getSuperRole()
          Returns the direct superrole of this role.
 Role[] getSuperRoles()
          Returns recursively all Role object instances that are a superrole of this role.
 MenuItem[] getToolbarElementIcons()
          Returns all toolbar elements that are shown as icons in the toolbar for a role, including the toolbar elemens for super roles.
 MenuItem[] getToolbarElements()
          Returns all toolbar elements for a role, including the toolbar elements for super roles.
 User[] getUsers()
          Returns an array of users that are in this role.
 boolean isDeveloperRole()
          A role is considered to be a developer role if at least one permission group is assigned to the role with 'development=true'.
 boolean isValidSuperRole(Role superRoleCandidate)
          Return true if the superRoleCandidate a valid super role for this role.
 void setAllWebInitiatives(boolean allwebs)
          Sets the all web initiatives property to the given value
 void setName(java.lang.String name)
          Set the name of the role.
 void setPermissionGroups(PermissionGroup[] groups)
          Set the permission groups of a role.
 void setPermissions(Permission[] permissions)
          Set the permissions of a role.
 void setSuperRole(Role role)
          Set the direct superrole of this role.
 void setToolbarElementIcons(MenuItem[] toolbarElements)
          Sets the toolbar elements that are shown as icons in the toolbar for a role.
 void setUsers(User[] users)
          Set the users that are in this role.
 
Methods inherited from class nl.gx.webmanager.authorization.impl.HtmlObjectWrapperImpl
assignRelatedObject, delete, equals, getAssignment, getAssignmentObjects, getAssignments, getId, getUuid, removeRelatedObjects, setAssignment, setAssignments, setComponent, setId, setNode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.gx.webmanager.authorization.HtmlObjectWrapper
getId, getUuid
 

Constructor Detail

RoleImpl

public RoleImpl()
Default constructor for a Role implementation instance.


RoleImpl

public RoleImpl(java.lang.String id)
Constructor for a Role implementation taking the id of the siteworks object it wraps as a parameter.

Parameters:
id - Id of a GroupObject siteworks object
Method Detail

checkAccess

public boolean checkAccess(java.lang.String permissionValue)
Description copied from interface: Role
Returns true if this role has access to given permission.

Specified by:
checkAccess in interface Role
Parameters:
permissionValue - Value that uniquely identifies the permission to check
Returns:
true if this role has access to given permission

setName

public void setName(java.lang.String name)
Description copied from interface: Role
Set the name of the role.

Specified by:
setName in interface Role
Parameters:
name - Name for the role.

getName

public java.lang.String getName()
Description copied from interface: Role
Returns the name of the role.

Specified by:
getName in interface Role
Returns:
the name of the role

getPermissionGroups

public PermissionGroup[] getPermissionGroups()
Description copied from interface: Role
Returns all PermissionGroup object instances assigned to the role.

Specified by:
getPermissionGroups in interface Role
Returns:
all PermissionGroup object instances assigned to the role

getSubRoles

public Role[] getSubRoles()
Description copied from interface: Role
Returns all Role object instances that are a subrole of this role.

Specified by:
getSubRoles in interface Role
Returns:
all Role object instances that are a subrole of this role

getSuperRoles

public Role[] getSuperRoles()
Description copied from interface: Role
Returns recursively all Role object instances that are a superrole of this role.

Specified by:
getSuperRoles in interface Role
Returns:
recursively all Role object instances that are a superrole of this role

setSuperRole

public void setSuperRole(Role role)
Description copied from interface: Role
Set the direct superrole of this role.

Specified by:
setSuperRole in interface Role
Parameters:
role - Role to set as direct superrole

getSuperRole

public Role getSuperRole()
Description copied from interface: Role
Returns the direct superrole of this role.

Specified by:
getSuperRole in interface Role
Returns:
The direct superrole of this role.

isDeveloperRole

public boolean isDeveloperRole()
Description copied from interface: Role
A role is considered to be a developer role if at least one permission group is assigned to the role with 'development=true'. The permission group may also be inherited from a super role. By default this is only the 'Developer' permission group.

Specified by:
isDeveloperRole in interface Role
Returns:
true if this Role is considered to be a developer role, false otherwise

setAllWebInitiatives

public void setAllWebInitiatives(boolean allwebs)
Description copied from interface: Role
Sets the all web initiatives property to the given value

Specified by:
setAllWebInitiatives in interface Role
Parameters:
allwebs - value of the web initiatives property

getAllWebInitiatives

public boolean getAllWebInitiatives()
Description copied from interface: Role
Return if this role is available on all web initiatives

Specified by:
getAllWebInitiatives in interface Role
Returns:
true if the role is available on all web initiatives, false otherwise

setPermissionGroups

public void setPermissionGroups(PermissionGroup[] groups)
Description copied from interface: Role
Set the permission groups of a role.

Specified by:
setPermissionGroups in interface Role
Parameters:
groups - Array of PermissionGroup object instances

setPermissions

public void setPermissions(Permission[] permissions)
Description copied from interface: Role
Set the permissions of a role.

Specified by:
setPermissions in interface Role
Parameters:
permissions - Array of Permission object instances

getAllPermissions

public Permission[] getAllPermissions()
Description copied from interface: Role
Returns all permissions assigned to this role, directly by a permission group or by inheritence of roles.

Specified by:
getAllPermissions in interface Role
Returns:
Array with all permissions assigned to this role

getPermissions

public Permission[] getPermissions()
Description copied from interface: Role
This method returns only the permissions that are assigned to this role explicitely. Permissions assgined from a permission group or inherited from a superrole are not included.

Specified by:
getPermissions in interface Role
Returns:
Array of all explicitely assigned permissions

getGroupPermissions

public Permission[] getGroupPermissions()
Description copied from interface: Role
This method returns all permissions that are assigned indirectly by assiging permission groups to the role. It does not include explicitely assigned permissions or inherited permissions.

Specified by:
getGroupPermissions in interface Role
Returns:
Array of all permissions assigned from permission groups

getInheritedPermissions

public Permission[] getInheritedPermissions()
Description copied from interface: Role
This method returns all permissions that were inherited from from a superrole. It does not include any explicitely assigned permission or permission assigned from a permission group

Specified by:
getInheritedPermissions in interface Role
Returns:
Array of all permissions inherited from superroles

setUsers

public void setUsers(User[] users)
Description copied from interface: Role
Set the users that are in this role.

Specified by:
setUsers in interface Role
Parameters:
users - Array of User class instances.

getUsers

public User[] getUsers()
Description copied from interface: Role
Returns an array of users that are in this role.

Specified by:
getUsers in interface Role
Returns:
an array of users that are in this role

getToolbarElements

public MenuItem[] getToolbarElements()
Description copied from interface: Role
Returns all toolbar elements for a role, including the toolbar elements for super roles.

Specified by:
getToolbarElements in interface Role
Returns:
All toolbar elements for a role, including the toolbar elements for super roles

getToolbarElementIcons

public MenuItem[] getToolbarElementIcons()
Description copied from interface: Role
Returns all toolbar elements that are shown as icons in the toolbar for a role, including the toolbar elemens for super roles.

Specified by:
getToolbarElementIcons in interface Role
Returns:
All toolbar elements that are shown as icons in the toolbar for a role, including the toolbar elemens for super roles

setToolbarElementIcons

public void setToolbarElementIcons(MenuItem[] toolbarElements)
Description copied from interface: Role
Sets the toolbar elements that are shown as icons in the toolbar for a role.

Specified by:
setToolbarElementIcons in interface Role
Parameters:
toolbarElements - Array of toolbar elements

copyPermissionsFromGroup

public void copyPermissionsFromGroup(java.lang.String permissionGroupId)
Specified by:
copyPermissionsFromGroup in interface Role

getPageSectionLabels

public java.lang.String[] getPageSectionLabels()
Description copied from interface: Role
Return all page section labels assigned to this role

Specified by:
getPageSectionLabels in interface Role
Returns:

isValidSuperRole

public boolean isValidSuperRole(Role superRoleCandidate)
Description copied from interface: Role
Return true if the superRoleCandidate a valid super role for this role. The superRoleCandidate is not a valid super role for this role if this role is one of this superRoleCandidate's super roles.

Specified by:
isValidSuperRole in interface Role
Parameters:
superRoleCandidate - Role to check whether it may be a valid superrole for this role
Returns:
true if the superRoleCandidate a valid super role for this role


Copyright © 2007-2011 GX Software BV. All Rights Reserved.