Package lumis.portal.serviceinstance.acl
Class ServiceInstanceAclManager
- java.lang.Object
-
- lumis.util.security.acl.AclManager
-
- lumis.portal.serviceinstance.acl.ServiceInstanceAclManager
-
- All Implemented Interfaces:
IConfigKeyChecker
,IServiceInstanceAclManager
,IAclManager
public class ServiceInstanceAclManager extends AclManager implements IServiceInstanceAclManager
Implements the Service Instance ACL Management Interface- Since:
- 4.0.0
- Version:
- $Revision$ $Date$
-
-
Field Summary
-
Fields inherited from class lumis.util.security.acl.AclManager
aclCache, checkRequiredPermissionsInternalFlag
-
Fields inherited from interface lumis.portal.serviceinstance.acl.IServiceInstanceAclManager
PERMISSION_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description ServiceInstanceAclManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction)
Add an Access Control List to the Service Instance.void
checkRequiredPermissions(AccessControlList acl)
Checks if the required permissions were given for someone.boolean
checkServiceInstancePermission(SessionConfig sessionConfig, java.lang.String userId, java.lang.String serviceInstanceId, java.lang.String permissionId, ITransaction transaction)
Checks if an user has a permission on a service instance.boolean
checkServiceInstancePermission(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String permissionId, ITransaction transaction)
Checks if an user has a permission on a service instance.void
clearCache(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
Reloads the ACL associated with the given serviceInstanceId.AccessControlList
get(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
Get the Service Instance's Access Control List.protected AccessControlList
getAclInternal(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction)
ServiceInstancePermissions
getPermissions(SessionConfig sessionConfig, java.lang.String serviceId, ITransaction transaction)
protected int
getRequiredPermissions()
void
update(SessionConfig sessionConfig, java.lang.String serviceInstanceId, AccessControlList acl, ITransaction transaction)
Update the Service Instance's ACL.-
Methods inherited from class lumis.util.security.acl.AclManager
add, add, addOrUpdate, checkPermission, checkPermission, checkRequiredPermissionsInternal, cleanupInvalidData, clearCache, delete, deleteAclEntryByPrincipalId, deserialize, exists, keyExists, removeFromCache, serialize, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.util.security.acl.IAclManager
add, addOrUpdate, checkPermission, checkPermission, clearCache, delete, deleteAclEntryByPrincipalId, deserialize, exists, removeFromCache, serialize
-
Methods inherited from interface lumis.portal.serialization.operation.IConfigKeyChecker
keyExists
-
-
-
-
Method Detail
-
add
public java.lang.String add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInstanceAclManager
Add an Access Control List to the Service Instance. To access this method, the user needs the PERMISSION_TYPE_MANAGE_SERVICE_INSTANCE_SECURITY permission in the service instance.- Specified by:
add
in interfaceIServiceInstanceAclManager
- Returns:
- String: New ACL Id
- Throws:
ManagerException
PortalException
-
get
public AccessControlList get(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInstanceAclManager
Get the Service Instance's Access Control List. To access this method, the user needs the PERMISSION_TYPE_MANAGE_SERVICE_INSTANCE_SECURITY permission in the service instance.- Specified by:
get
in interfaceIServiceInstanceAclManager
- Specified by:
get
in classAclManager
- Returns:
- Returns the AccessControlList.
- Throws:
ManagerException
PortalException
-
update
public void update(SessionConfig sessionConfig, java.lang.String serviceInstanceId, AccessControlList acl, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInstanceAclManager
Update the Service Instance's ACL. To access this method, the user needs the PERMISSION_TYPE_MANAGE_SERVICE_INSTANCE_SECURITY permission in the service instance.- Specified by:
update
in interfaceIServiceInstanceAclManager
- Throws:
ManagerException
PortalException
-
clearCache
public void clearCache(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInstanceAclManager
Reloads the ACL associated with the given serviceInstanceId.- Specified by:
clearCache
in interfaceIServiceInstanceAclManager
- Throws:
ManagerException
PortalException
-
getPermissions
public ServiceInstancePermissions getPermissions(SessionConfig sessionConfig, java.lang.String serviceId, ITransaction transaction) throws ManagerException, PortalException
- Specified by:
getPermissions
in interfaceIServiceInstanceAclManager
- Returns:
- Returns the ServiceInstancePermissions.
- Throws:
ManagerException
PortalException
-
getAclInternal
protected AccessControlList getAclInternal(SessionConfig sessionConfig, java.lang.String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
- Specified by:
getAclInternal
in classAclManager
- Throws:
ManagerException
PortalException
-
getRequiredPermissions
protected int getRequiredPermissions() throws PortalException
- Specified by:
getRequiredPermissions
in classAclManager
- Throws:
PortalException
-
checkRequiredPermissions
public void checkRequiredPermissions(AccessControlList acl) throws PortalException
Description copied from interface:IServiceInstanceAclManager
Checks if the required permissions were given for someone. If not an exception is thrown.- Specified by:
checkRequiredPermissions
in interfaceIServiceInstanceAclManager
- Parameters:
acl
- the acl to be checked.- Throws:
PortalException
- if the required permissions were not given.
-
checkServiceInstancePermission
public boolean checkServiceInstancePermission(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String permissionId, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInstanceAclManager
Checks if an user has a permission on a service instance.This method is a shortcut for
IAclManager.checkPermission(SessionConfig, String, IPermission, ITransaction)
that obtains theIPermission
object from the service instance permissions.- Specified by:
checkServiceInstancePermission
in interfaceIServiceInstanceAclManager
- Parameters:
sessionConfig
- the current user session information.serviceInstanceId
- the service instance identifier.permissionId
- the permission identifier. May be either one of the standard permissions or a custom permission defined in the service instance's service.transaction
- the transaction for persistence access.- Returns:
true
if the user has the permission,false
otherwise.- Throws:
PortalObjectNotFoundException
- if the service instance or the permission was not found.PortalException
- See Also:
ServiceInstancePermissions.PERMISSION_ID_MANAGE_SERVICE_INSTANCE_SECURITY
,ServiceInstancePermissions.PERMISSION_ID_MANAGE_SERVICE_INSTANCE
,ServiceInstancePermissions.PERMISSION_ID_EDIT_SERVICE_INSTANCE_CONTENT
,ServiceInstancePermissions.PERMISSION_ID_VIEW_SERVICE_INSTANCE
-
checkServiceInstancePermission
public boolean checkServiceInstancePermission(SessionConfig sessionConfig, java.lang.String userId, java.lang.String serviceInstanceId, java.lang.String permissionId, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInstanceAclManager
Checks if an user has a permission on a service instance.This method is a shortcut for
IAclManager.checkPermission(SessionConfig, String, String, IPermission, ITransaction)
that obtains theIPermission
object from the service instance permissions.- Specified by:
checkServiceInstancePermission
in interfaceIServiceInstanceAclManager
- Parameters:
sessionConfig
- the current user session information.userId
- the identifier of the user to check for permission.serviceInstanceId
- the service instance identifier.permissionId
- the permission identifier. May be either one of the standard permissions or a custom permission defined in the service instance's service.transaction
- the transaction for persistence access.- Returns:
true
if the user has the permission,false
otherwise.- Throws:
PortalObjectNotFoundException
- if the service instance or the permission was not found.PortalException
- See Also:
ServiceInstancePermissions.PERMISSION_ID_MANAGE_SERVICE_INSTANCE_SECURITY
,ServiceInstancePermissions.PERMISSION_ID_MANAGE_SERVICE_INSTANCE
,ServiceInstancePermissions.PERMISSION_ID_EDIT_SERVICE_INSTANCE_CONTENT
,ServiceInstancePermissions.PERMISSION_ID_VIEW_SERVICE_INSTANCE
-
-