Interface AccessModeService
-
- All Known Implementing Classes:
AccessModeServiceImpl
@ExperimentalApi @ParametersAreNonnullByDefault @ReturnValuesAreNonnullByDefault public interface AccessModeService
- Since:
- 6.8.0
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
getAccessMode
AccessMode getAccessMode()
- Returns:
- the maintenance info
- Since:
- 6.8.0
-
updateAccessMode
void updateAccessMode(AccessMode accessMode) throws ServiceException
Update the access mode if the current user is a sysadmin- 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- Since:
- 6.8.0
-
isReadOnlyAccessModeEnabled
boolean isReadOnlyAccessModeEnabled()
- Returns:
- true if the dark feature "read.only.mode" is enabled and current access mode is READ_ONLY
- Since:
- 6.8.0
-
shouldEnforceReadOnlyAccess
boolean shouldEnforceReadOnlyAccess()
- Returns:
- true if we should enforce read only access (without exemptions)
- Since:
- 6.9.0
-
withReadOnlyAccessExemption
<T> T withReadOnlyAccessExemption(Callable<T> callable) throws ServiceException
Execute a method that needs to be exempt from read-only access check in the permission manager layer.- Type Parameters:
T
- the return type of the method- Parameters:
callable
- the method- Returns:
- the value returned by the callable method
- Throws:
ServiceException
-
-