Package mondrian.olap
Class RoleImpl
- java.lang.Object
-
- mondrian.olap.RoleImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRoleImpl.DelegatingHierarchyAccessImplementation ofRole.HierarchyAccessthat delegates all methods to an underlying hierarchy access.-
Nested classes/interfaces inherited from interface mondrian.olap.Role
Role.AllHierarchyAccess, Role.HierarchyAccess, Role.RollupPolicy
-
-
Constructor Summary
Constructors Constructor Description RoleImpl()Creates a role with no permissions.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanAccess(OlapElement olapElement)Returns whether this role is allowed to see a given element.protected RoleImplclone()static Role.HierarchyAccesscreateAllAccess(Hierarchy hierarchy)Creates an element which represents all access to a hierarchy.booleanequals(Object obj)AccessgetAccess(Cube cube)Returns the access this role has to a given cube.AccessgetAccess(Dimension dimension)Returns the access this role has to a given dimension.AccessgetAccess(Hierarchy hierarchy)Returns the access this role has to a given hierarchy.AccessgetAccess(Level level)Returns the access this role has to a given level.AccessgetAccess(Member member)Returns the access this role has to a given member.AccessgetAccess(NamedSet set)Returns the access this role has to a given named set.AccessgetAccess(Schema schema)Returns the access this role has to a given schema.Role.HierarchyAccessgetAccessDetails(Hierarchy hierarchy)Returns the details of this hierarchy's access, or null if the hierarchy has not been given explicit access.voidgrant(Cube cube, Access access)Defines access to a cube.voidgrant(Dimension dimension, Access access)Defines access to a dimension.voidgrant(Hierarchy hierarchy, Access access, Level topLevel, Level bottomLevel, Role.RollupPolicy rollupPolicy)Defines access to a hierarchy.voidgrant(Member member, Access access)Defines access to a member in a hierarchy.voidgrant(Schema schema, Access access)Defines access to all cubes and dimensions in a schema.inthashCode()booleanisMutable()Returns whether modifications are possible.voidmakeImmutable()Prevents any further modifications.RoleImplmakeMutableClone()Returns a copy of thisRolewhich can be modified.static Roleunion(List<Role> roleList)Returns a role that is the union of the given roles.
-
-
-
Method Detail
-
makeMutableClone
public RoleImpl makeMutableClone()
Returns a copy of thisRolewhich can be modified.
-
makeImmutable
public void makeImmutable()
Prevents any further modifications.
-
isMutable
public boolean isMutable()
Returns whether modifications are possible.
-
grant
public void grant(Schema schema, Access access)
Defines access to all cubes and dimensions in a schema.- Parameters:
schema- Schema whose access to grant/deny.access- Anaccess code
-
getAccess
public Access getAccess(Schema schema)
Description copied from interface:RoleReturns the access this role has to a given schema.
-
grant
public void grant(Cube cube, Access access)
Defines access to a cube.- Parameters:
cube- Cube whose access to grant/deny.access- Anaccess code
-
getAccess
public Access getAccess(Cube cube)
Description copied from interface:RoleReturns the access this role has to a given cube.
-
grant
public void grant(Dimension dimension, Access access)
Defines access to a dimension.- Parameters:
dimension- Dimension whose access to grant/deny.access- An Access instance
-
getAccess
public Access getAccess(Dimension dimension)
Description copied from interface:RoleReturns the access this role has to a given dimension.
-
grant
public void grant(Hierarchy hierarchy, Access access, Level topLevel, Level bottomLevel, Role.RollupPolicy rollupPolicy)
Defines access to a hierarchy.- Parameters:
hierarchy- Hierarchy whose access to grant/deny.access- Anaccess codetopLevel- Top-most level which can be accessed, or null if the highest level. May only be specified ifaccessisAccess.CUSTOM.bottomLevel- Bottom-most level which can be accessed, or null if the lowest level. May only be specified ifaccessisAccess.CUSTOM.rollupPolicy- Rollup policy
-
getAccess
public Access getAccess(Hierarchy hierarchy)
Description copied from interface:RoleReturns the access this role has to a given hierarchy.
-
getAccessDetails
public Role.HierarchyAccess getAccessDetails(Hierarchy hierarchy)
Description copied from interface:RoleReturns the details of this hierarchy's access, or null if the hierarchy has not been given explicit access.- Specified by:
getAccessDetailsin interfaceRole
-
getAccess
public Access getAccess(Level level)
Description copied from interface:RoleReturns the access this role has to a given level.
-
grant
public void grant(Member member, Access access)
Defines access to a member in a hierarchy.Notes:
- The order of grants matters. If you grant/deny access to a member, previous grants/denials to its descendants are ignored.
- Member grants do not supersde top/bottom levels set using
grant(Hierarchy, Access, Level, Level, mondrian.olap.Role.RollupPolicy). - If you have access to a member, then you can see its ancestors even those explicitly denied, up to the top level.
-
getAccess
public Access getAccess(Member member)
Description copied from interface:RoleReturns the access this role has to a given member.
-
getAccess
public Access getAccess(NamedSet set)
Description copied from interface:RoleReturns the access this role has to a given named set.
-
canAccess
public boolean canAccess(OlapElement olapElement)
Description copied from interface:RoleReturns whether this role is allowed to see a given element.
-
createAllAccess
public static Role.HierarchyAccess createAllAccess(Hierarchy hierarchy)
Creates an element which represents all access to a hierarchy.- Parameters:
hierarchy- Hierarchy- Returns:
- element representing all access to a given hierarchy
-
-