Class SuperUserClientSideElement
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.StaticFileImportsClientSideElement
org.ametys.core.ui.StaticClientSideElement
org.ametys.runtime.plugins.admin.superuser.SuperUserClientSideElement
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
SuperUserClientSideElement
This implementation creates a control allowing to affect a super user to a given context
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
Field Summary
Modifier and TypeFieldDescriptionprotected ProfileAssignmentStorageExtensionPoint
The profile assignments storageprotected RightProfilesDAO
The profiles DAOprotected RightAssignmentContextExtensionPoint
The extension point for right contextsprotected RightsExtensionPoint
The extension point for the rightsprotected ServiceManager
The service managerprotected UserHelper
The user helperFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaffectUserToNewProfile
(Map<String, String> user, String newProfileName, Map<String, Object> jsParameters) Affect a user to a new super profile on the given context.void
Affect a user to the given profile on the given contextgetContextualParameters
(Map<String, Object> jsParameters) Get the contextual parameters used to determines the root contextsvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_sManager
The service manager -
_rightsEP
The extension point for the rights -
_profilesDAO
The profiles DAO -
_profileAssignmentStorageEP
The profile assignments storage -
_rightCtxEP
The extension point for right contexts -
_userHelper
The user helper
-
-
Constructor Details
-
SuperUserClientSideElement
public SuperUserClientSideElement()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
affectUserToProfile
public void affectUserToProfile(Map<String, String> user, String profileId, Map<String, Object> jsParameters) Affect a user to the given profile on the given context- Parameters:
user
- The userprofileId
- The profile idjsParameters
- The client-side parameters
-
affectUserToNewProfile
public String affectUserToNewProfile(Map<String, String> user, String newProfileName, Map<String, Object> jsParameters) Affect a user to a new super profile on the given context. First, a new profile with the given name will be created and filled with all rights, and then the user will be affected.- Parameters:
user
- The usernewProfileName
- The name of the super profile to createjsParameters
- The client-side parameters- Returns:
- The id of the created profile
-
getContextualParameters
Get the contextual parameters used to determines the root contexts- Parameters:
jsParameters
- the client-side parameters- Returns:
- the contextual parameters
-