Class AccessRightsManager
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- de.hybris.platform.odata2webservicesfeaturetests.useraccess.AccessRightsManager
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class AccessRightsManager extends org.junit.rules.ExternalResourceA utility for managing user access rights in the system. The implementation is not thread safe.
-
-
Constructor Summary
Constructors Constructor Description AccessRightsManager(PermissionManagementService mgr)Instantiates this manager.
-
Method Summary
-
-
-
Constructor Detail
-
AccessRightsManager
public AccessRightsManager(PermissionManagementService mgr)
Instantiates this manager.- Parameters:
mgr- a service to use for managing user access permissions.
-
-
Method Detail
-
accessRights
public static AccessRightsManager accessRights()
Creates new instance of this manager with thePermissionManagementServicethat is available in the application context.- Returns:
- new access rights manager instance.
-
forUser
public AccessRightsManager forUser(java.lang.String uid)
-
forUser
public AccessRightsManager forUser(UserModel model)
-
forTypes
public AccessRightsManager forTypes(java.lang.String... typeCodes)
-
forType
public AccessRightsManager forType(java.lang.String type)
-
forType
public AccessRightsManager forType(ComposedTypeModel model)
-
grantAll
public AccessRightsManager grantAll()
-
revokeAll
public AccessRightsManager revokeAll()
-
grantRead
public AccessRightsManager grantRead()
-
revokeRead
public AccessRightsManager revokeRead()
-
grantCreate
public AccessRightsManager grantCreate()
-
revokeCreate
public AccessRightsManager revokeCreate()
-
grantUpdate
public AccessRightsManager grantUpdate()
-
revokeUpdate
public AccessRightsManager revokeUpdate()
-
grantDelete
public AccessRightsManager grantDelete()
-
revokeDelete
public AccessRightsManager revokeDelete()
-
apply
public AccessRightsManager 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
public AccessRightsManager 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
-
-