public class AccessManager extends Object
Platform AccessManager
. TODO: This class is only for legacy reasons here. The callers should rather use the AccesssManager from
jalo.security package directly. Before removing this class we have to make sure that everything can be covered by the
AccessManager from jalo.| Modifier and Type | Class and Description |
|---|---|
static class |
AccessManager.PrincipalComparator
This comparator is used to alphabetically sort a list of principals.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CHANGE |
static String |
CHANGE_PERMISSIONS |
static String |
CREATE |
static String |
DENY |
static String |
GRANT |
static String |
NONE |
static String |
READ |
static String |
REMOVE |
static SingletonCreator.Creator<AccessManager> |
SINGLETON_CREATOR |
static String |
SUPER_DENY |
static String |
SUPER_GRANT |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canChange(AttributeDescriptor descriptor) |
boolean |
canChange(ComposedType type) |
boolean |
canChangeInstance(Item item)
Returns true if the current user is allowed to change items of the given type and if all extensions which
implements RightsProvider do allow this operation on this item.
|
boolean |
canChangeInstance(Item item,
AttributeDescriptor att) |
boolean |
canChangePermissions(AttributeDescriptor descriptor) |
boolean |
canChangePermissions(ComposedType type) |
boolean |
canCreate(ComposedType type) |
boolean |
canCreateInstance(Item item)
Returns true if the current user is allowed to create items of the given type and if all extensions implementing
RightsProvider allow editing this item.
|
boolean |
canCreateInstance(Item item,
AttributeDescriptor att) |
boolean |
canRead(AttributeDescriptor descriptor) |
boolean |
canRead(ComposedType type) |
boolean |
canRemove(ComposedType type) |
boolean |
canRemoveInstance(Item item)
Returns true if the current user is allowed to remove items of the given type and if all extensions implementing
RightsProvider allow editing this item.
|
boolean |
canRemoveInstance(Item item,
AttributeDescriptor att)
Returns true if the current user is allowed to remove items of the given type and if all extensions implementing
RightsProvider allow editing this item.
|
ArrayList |
checkLicence()
This Method returns a list with
LicenceInfo objects. |
static void |
filterInvalidPrincipals(Set principals)
Filters invalid principals in the given set.
|
List<UserRight> |
getDescriptorUserRights()
Returns a map containing the three UserRight objects for the keys READ, CHANGE, and CHANGE_PERMISSIONS...
|
static AccessManager |
getInstance()
Returns an instance of AccessManager.
|
Map |
getPermissionMap(AttributeDescriptor attributeDescriptor)
Returns the permission map for the given AttributeDescriptor (see
Item.getPermissionMap() ) and all 3 userrights which
the hmc uses on AttributeDescriptors. |
Map |
getPermissionMap(ComposedType type)
Returns the permission map for the given ComposedType.
|
Map |
getPermissionMap(Principal principal)
Returns the permission map for the given Principal and all 5 userrights which the hmc uses on
AttributeDescriptors.
|
Set<Language> |
getRestrictedLanguages(Item item) |
int |
getRightIndex(String userRight)
For the given userright key this method returns the index of the appropriate UserRight within the userright list.
|
List<UserRight> |
getTypeUserRights()
Returns a map containing the five UserRight objects for the keys READ, CHANGE, CREATE, REMOVE and
CHANGE_PERMISSIONS...
|
boolean |
hasRight(AttributeDescriptor descriptor,
String userRightKey)
Checks if the current Principal has the given right on the given AttributeDescriptor.
|
boolean |
hasRight(ComposedType type,
String userRightKey)
Checks if the current Principal has the given right on the given ComposedType.
|
boolean |
hasRight(Principal principal,
AttributeDescriptor descriptor,
String userRightKey)
Checks if the given Principal has the given right on the given AttributeDescriptor.
|
boolean |
hasRight(Principal principal,
ComposedType type,
String userRightKey)
Checks if the given Principal has the given right on the given ComposedType.
|
boolean |
isAdmin()
Returns true if the current jalosession user is in the admin group.
|
boolean |
isAdmin(Principal principal)
Returns true if the given principal is in the admin group.
|
static void |
resetUserRights() |
void |
setPermissionMap(AttributeDescriptor attributeDescriptor,
Map permissionMap)
Sets the permission map for the given AttributeDescriptor (see
Item.setPermissionsByMap() ) and all 3
userrights which the hmc uses on AttributeDescriptors. |
void |
setPermissionMap(ComposedType type,
Map permissionMap)
Sets the permission map for the given ComposedType (see
Item.setPermissionsByMap() ) and all 5
userrights which the hmc uses on ComposedTypes. |
void |
setPermissionMap(Principal principal,
Map permissionMap)
Sets the permission map for the given Principal and all 5 userrights which the hmc uses on items.
|
boolean |
subTypesVisible(ComposedType type)
Returns true if the given type or at least one of its subtypes is visible and non-abstract.
|
public static final String READ
public static final String CHANGE
public static final String CHANGE_PERMISSIONS
public static final String CREATE
public static final String REMOVE
public static final String GRANT
public static final String SUPER_GRANT
public static final String DENY
public static final String SUPER_DENY
public static final String NONE
public static final SingletonCreator.Creator<AccessManager> SINGLETON_CREATOR
public static final void resetUserRights()
public static final AccessManager getInstance()
public List<UserRight> getTypeUserRights()
public List<UserRight> getDescriptorUserRights()
public int getRightIndex(String userRight)
userRight - the user right key which must be one of READ, CHANGE, CREATE, REMOVE or CHANGE_PERMISSIONSpublic boolean hasRight(AttributeDescriptor descriptor, String userRightKey)
descriptor - the AttributeDescriptor which is checkeduserRightKey - the key for the userright which should be checked (one of READ, CHANGE, CREATE, REMOVE or
CHANGE_PERMISSIONS)public boolean hasRight(Principal principal, AttributeDescriptor descriptor, String userRightKey)
principal - the Principal for which the permission is checkeddescriptor - the AttributeDescriptor which is checkeduserRightKey - the key for the userright which should be checked (one of READ, CHANGE, CREATE, REMOVE or
CHANGE_PERMISSIONS)public boolean hasRight(ComposedType type, String userRightKey)
type - the ComposedType which is checkeduserRightKey - the key for the userright which should be checked (one of READ, CHANGE, CREATE, REMOVE or
CHANGE_PERMISSIONS)public boolean hasRight(Principal principal, ComposedType type, String userRightKey)
principal - the Principal for which the permission is checkedtype - the ComposedType which is checkeduserRightKey - the key for the userright which should be checked (one of READ, CHANGE, CREATE, REMOVE or
CHANGE_PERMISSIONS)public boolean isAdmin()
public boolean isAdmin(Principal principal)
public boolean canChangeInstance(Item item)
item - Itempublic boolean canChangeInstance(Item item, AttributeDescriptor att)
public boolean canChange(ComposedType type)
public boolean canChange(AttributeDescriptor descriptor)
public boolean canRead(ComposedType type)
public boolean canRead(AttributeDescriptor descriptor)
public boolean canRemoveInstance(Item item)
item - Itempublic boolean canRemoveInstance(Item item, AttributeDescriptor att)
item - the itematt - the attribute descriptorpublic boolean canRemove(ComposedType type)
public boolean canChangePermissions(ComposedType type)
public boolean canChangePermissions(AttributeDescriptor descriptor)
public boolean canCreateInstance(Item item)
item - Itempublic boolean canCreateInstance(Item item, AttributeDescriptor att)
public boolean canCreate(ComposedType type)
public Map getPermissionMap(ComposedType type)
Item.getPermissionMap() ) and all 5 userrights which
the hmc uses on ComposedTypes.public Map getPermissionMap(AttributeDescriptor attributeDescriptor)
Item.getPermissionMap() ) and all 3 userrights which
the hmc uses on AttributeDescriptors.public static void filterInvalidPrincipals(Set principals)
principals - the set which is to be checkedpublic void setPermissionMap(ComposedType type, Map permissionMap)
Item.setPermissionsByMap() ) and all 5
userrights which the hmc uses on ComposedTypes.public void setPermissionMap(AttributeDescriptor attributeDescriptor, Map permissionMap)
Item.setPermissionsByMap() ) and all 3
userrights which the hmc uses on AttributeDescriptors.public Map getPermissionMap(Principal principal)
public void setPermissionMap(Principal principal, Map permissionMap)
public boolean subTypesVisible(ComposedType type)
public ArrayList checkLicence()
LicenceInfo objects. The size of this
list is equal to how many licence terms exists.AccessManager.checkLicence()Copyright © 2017 SAP SE. All Rights Reserved.