Class AccessModeServiceImpl
- java.lang.Object
-
- com.atlassian.confluence.api.impl.service.accessmode.AccessModeServiceImpl
-
- All Implemented Interfaces:
AccessModeService
@Component public class AccessModeServiceImpl extends Object implements AccessModeService
- Since:
- 6.8.0
-
-
Constructor Summary
Constructors Constructor Description AccessModeServiceImpl(AccessModeManager accessModeManager, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, LicenseService licenseService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessMode
getAccessMode()
boolean
isReadOnlyAccessModeEnabled()
boolean
shouldEnforceReadOnlyAccess()
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 Detail
-
AccessModeServiceImpl
@Autowired public AccessModeServiceImpl(AccessModeManager accessModeManager, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, LicenseService licenseService)
-
-
Method Detail
-
getAccessMode
public AccessMode getAccessMode()
- Specified by:
getAccessMode
in interfaceAccessModeService
- Returns:
- the maintenance info
-
updateAccessMode
public void updateAccessMode(AccessMode accessMode) throws ServiceException
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
public <T> T withReadOnlyAccessExemption(Callable<T> callable) throws ServiceException
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
-
-