Class AbstractAdminComponentSessionController
- java.lang.Object
-
- org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
-
- org.silverpeas.core.web.mvc.controller.AbstractAdminComponentSessionController
-
- All Implemented Interfaces:
Serializable
,ComponentSessionController
,SessionCloseable
- Direct Known Subclasses:
ImportExportSessionController
,JobDomainPeasSessionController
,JobManagerPeasSessionController
,JobStartPagePeasSessionController
,PdcSessionController
,SilverStatisticsPeasSessionController
,TemplateDesignerSessionController
,VariablesSessionController
,WorkflowDesignerSessionController
public abstract class AbstractAdminComponentSessionController extends AbstractComponentSessionController
This abstraction centralizes common processes dedicated to severalAbstractComponentSessionController
implementations in charge of the management of administration services.To be fully functional, an implementation of this abstraction MUST be used with an
AdminComponentRequestRouter
implementation.- Author:
- silveryocha
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
context
-
-
Constructor Summary
Constructors Constructor Description AbstractAdminComponentSessionController(MainSessionController controller, ComponentContext context, String localizedMessagesBundleName)
AbstractAdminComponentSessionController(MainSessionController controller, ComponentContext context, String localizedMessagesBundleName, String iconFileName)
AbstractAdminComponentSessionController(MainSessionController controller, ComponentContext context, String localizedMessagesBundleName, String iconFileName, String settingsFileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAccessGranted()
This method is invoked at each administration service access.void
checkAccessGranted(String spaceId, String instanceId, boolean readOnly)
Checks the user can access administration about a space or a component instance.void
checkAdminAccessOnly()
Checks the user has full admin access.boolean
isAccessGranted()
Used mainly bycheckAccessGranted()
.boolean
isAccessGranted(String spaceId, String instanceId, boolean readOnly)
Indicates if the user can access administration about a space or a component instance.boolean
isUserAdmin()
void
setAppModeMaintenance(boolean mode)
void
setSpaceModeMaintenance(String spaceId, boolean mode)
protected void
throwForbiddenError()
-
Methods inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
addClipboardSelection, clipboardPasteDone, close, getClipboardErrorMessage, getClipboardExceptionError, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getHighestSilverpeasUserRole, getIcon, getLanguage, getLook, getMultilang, getOrganisationController, getPersonalization, getRSSUrl, getSelection, getSettings, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, getZoneId, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setClipboardSelectedElement, setComponentRootName
-
-
-
-
Constructor Detail
-
AbstractAdminComponentSessionController
public AbstractAdminComponentSessionController(MainSessionController controller, ComponentContext context, String localizedMessagesBundleName)
-
AbstractAdminComponentSessionController
public AbstractAdminComponentSessionController(MainSessionController controller, ComponentContext context, String localizedMessagesBundleName, String iconFileName)
-
AbstractAdminComponentSessionController
public AbstractAdminComponentSessionController(MainSessionController controller, ComponentContext context, String localizedMessagesBundleName, String iconFileName, String settingsFileName)
-
-
Method Detail
-
setAppModeMaintenance
public void setAppModeMaintenance(boolean mode)
- Specified by:
setAppModeMaintenance
in interfaceComponentSessionController
- Overrides:
setAppModeMaintenance
in classAbstractComponentSessionController
-
setSpaceModeMaintenance
public void setSpaceModeMaintenance(String spaceId, boolean mode)
- Specified by:
setSpaceModeMaintenance
in interfaceComponentSessionController
- Overrides:
setSpaceModeMaintenance
in classAbstractComponentSessionController
-
isUserAdmin
public boolean isUserAdmin()
-
checkAdminAccessOnly
public void checkAdminAccessOnly()
Checks the user has full admin access.
-
isAccessGranted
public boolean isAccessGranted()
Used mainly bycheckAccessGranted()
.Each implementation can precise or change this default implementation.
- Returns:
- true if access granted, false otherwise.
-
checkAccessGranted
public void checkAccessGranted()
This method is invoked at each administration service access.- Throws:
ForbiddenRuntimeException
- in case the user has forbidden access.
-
isAccessGranted
public boolean isAccessGranted(String spaceId, String instanceId, boolean readOnly) throws ForbiddenRuntimeException
Indicates if the user can access administration about a space or a component instance.Whatever the parameters, user having admin access right on its account is always access granted.
If both space id and instance id are given, they are both verified.
If neither space if neither instance id are given, it is verified that current user is a space manager.
- Parameters:
spaceId
- the optional identifier of a space.instanceId
- the optional identifier of a component instance.readOnly
- true if the operation is read only, false otherwise.- Returns:
- true if access granted, false otherwise.
- Throws:
ForbiddenRuntimeException
-
checkAccessGranted
public void checkAccessGranted(String spaceId, String instanceId, boolean readOnly) throws ForbiddenRuntimeException
Checks the user can access administration about a space or a component instance.Whatever the parameters, user having admin access right on its account is always access granted.
If both space id and instance id are given, they are both verified.
If neither space if neither instance id are given, it is verified that current user is a space manager.
- Parameters:
spaceId
- the optional identifier of a space.instanceId
- the optional identifier of a component instance.readOnly
- true if the operation is read only, false otherwise.- Throws:
ForbiddenRuntimeException
- in case the user has forbidden access.
-
throwForbiddenError
protected void throwForbiddenError()
-
-