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 AccessModegetAccessMode()booleanisReadOnlyAccessModeEnabled()booleanshouldEnforceReadOnlyAccess()voidupdateAccessMode(AccessMode accessMode)Update the access mode if the current user is a sysadmin<T> TwithReadOnlyAccessExemption(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:
getAccessModein interfaceAccessModeService- Returns:
- the maintenance info
-
updateAccessMode
public void updateAccessMode(AccessMode accessMode) throws ServiceException
Description copied from interface:AccessModeServiceUpdate the access mode if the current user is a sysadmin- Specified by:
updateAccessModein 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:
isReadOnlyAccessModeEnabledin 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:
shouldEnforceReadOnlyAccessin 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:AccessModeServiceExecute a method that needs to be exempt from read-only access check in the permission manager layer.- Specified by:
withReadOnlyAccessExemptionin interfaceAccessModeService- Type Parameters:
T- the return type of the method- Parameters:
callable- the method- Returns:
- the value returned by the callable method
- Throws:
ServiceException
-
-