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
FieldsModifier and TypeFieldDescriptionprotected ProfileAssignmentStorageExtensionPointThe profile assignments storageprotected RightProfilesDAOThe profiles DAOprotected RightAssignmentContextExtensionPointThe extension point for right contextsprotected RightsExtensionPointThe extension point for the rightsprotected ServiceManagerThe service managerprotected UserHelperThe user helperFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script -
Constructor Summary
Constructors -
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.voidAffect a user to the given profile on the given contextgetContextualParameters(Map<String, Object> jsParameters) Get the contextual parameters used to determines the root contextsvoidservice(ServiceManager smanager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParametersMethods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toStringMethods 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:
servicein interfaceServiceable- Overrides:
servicein 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
-