Class AccessRightsManager
java.lang.Object
org.junit.rules.ExternalResource
de.hybris.platform.integrationservices.AccessRightsManager
- All Implemented Interfaces:
org.junit.rules.TestRule
public class AccessRightsManager
extends org.junit.rules.ExternalResource
A utility for managing user access rights in the system. The implementation is not thread safe.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates this manager. -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessRightsManagerCreates new instance of this manager with thePermissionManagementServicethat is available in the application context.protected voidafter()apply()Applies permissions explicitly set by callinggrant...orrevoke...methods to the user and type, which were specified by callingforUser(UserModel)andforType(ComposedTypeModel)respectively.protected voidbefore()forType(ComposedTypeModel model) grantAll()reset()Resets access rights to the state they were in the system prior to the first call of theapply()method on this manager.Methods inherited from class org.junit.rules.ExternalResource
apply
-
Constructor Details
-
AccessRightsManager
Instantiates this manager.- Parameters:
mgr- a service to use for managing user access permissions.
-
-
Method Details
-
accessRights
Creates new instance of this manager with thePermissionManagementServicethat is available in the application context.- Returns:
- new access rights manager instance.
-
forUser
-
forUser
-
forTypes
-
forType
-
forType
-
grantAll
-
revokeAll
-
grantRead
-
revokeRead
-
grantCreate
-
revokeCreate
-
grantUpdate
-
revokeUpdate
-
grantDelete
-
revokeDelete
-
apply
Applies permissions explicitly set by callinggrant...orrevoke...methods to the user and type, which were specified by callingforUser(UserModel)andforType(ComposedTypeModel)respectively.Permissions, for which no
grant...orrevoke...methods were not called will be unspecified. -
reset
Resets access rights to the state they were in the system prior to the first call of theapply()method on this manager. -
before
protected void before()- Overrides:
beforein classorg.junit.rules.ExternalResource
-
after
protected void after()- Overrides:
afterin classorg.junit.rules.ExternalResource
-