Class AccessModeServiceImpl
java.lang.Object
com.atlassian.confluence.api.impl.service.accessmode.AccessModeServiceImpl
- All Implemented Interfaces:
AccessModeService
- Since:
- 6.8.0
-
Constructor Summary
ConstructorsConstructorDescriptionAccessModeServiceImpl
(AccessModeManager accessModeManager, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, LicenseService licenseService) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
updateAccessMode
(AccessMode accessMode) Update the access mode if the current user is a sysadmin<T> T
withReadOnlyAccessExemption
(Callable<T> callable) Execute a method that needs to be exempt from read-only access check in the permission manager layer.
-
Constructor Details
-
AccessModeServiceImpl
@Autowired public AccessModeServiceImpl(AccessModeManager accessModeManager, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, LicenseService licenseService)
-
-
Method Details
-
getAccessMode
- Specified by:
getAccessMode
in interfaceAccessModeService
- Returns:
- the maintenance info
-
updateAccessMode
Description copied from interface:AccessModeService
Update the access mode if the current user is a sysadmin- Specified by:
updateAccessMode
in interfaceAccessModeService
- Parameters:
accessMode
- update the access mode for Confluence- Throws:
ServiceException
- the exception is thrown if the dark feature is not enabled or the access mode cannot be updated
-
isReadOnlyAccessModeEnabled
public boolean isReadOnlyAccessModeEnabled()- Specified by:
isReadOnlyAccessModeEnabled
in interfaceAccessModeService
- Returns:
- true if the dark feature "read.only.mode" is enabled and current access mode is READ_ONLY
-
shouldEnforceReadOnlyAccess
public boolean shouldEnforceReadOnlyAccess()- Specified by:
shouldEnforceReadOnlyAccess
in interfaceAccessModeService
- Returns:
- true if we should enforce read only access (without exemptions)
-
withReadOnlyAccessExemption
Description copied from interface:AccessModeService
Execute a method that needs to be exempt from read-only access check in the permission manager layer.- Specified by:
withReadOnlyAccessExemption
in interfaceAccessModeService
- Type Parameters:
T
- the return type of the method- Parameters:
callable
- the method- Returns:
- the value returned by the callable method
- Throws:
ServiceException
-