Class ProfilesService
java.lang.Object
fr.paris.lutece.plugins.profiles.service.ProfilesService
- All Implemented Interfaces:
IProfilesService
ProfilesService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRightForProfile(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a right for a profilevoidaddRoleForProfile(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a role for a profilevoidaddUserForProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add an user for a profilevoidaddWorkgroupForProfile(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a workgroup for a profilebooleancheckExistProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile already exists or notbooleancheckProfileAttributed(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the profile is attributed to any userCreation of an instance of profilevoiddoAssignUserToProfile(int nIdUser, javax.servlet.http.HttpServletRequest request, Locale locale) Do assign user to a profilevoiddoUnassignUserFromProfile(int nIdUser, String strProfileKey, fr.paris.lutece.portal.business.user.AdminUser currentUser, javax.servlet.http.HttpServletRequest request, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Do unassign user from profilefindAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a collection of profiles objectsfindByPrimaryKey(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an instance of a profile whose identifier is specified in parameterfindProfileByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the list of profiles by a given ID userfindProfilesByFilter(ProfileFilter pFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find profile by filterfr.paris.lutece.util.html.ItemNavigatorgetItemNavigator(ProfileFilter pFilter, Profile profile, fr.paris.lutece.util.url.UrlItem url) Get the item navigatorgetListActions(fr.paris.lutece.portal.business.user.AdminUser user, Profile profile, String strPermission, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of actionsfr.paris.lutece.util.ReferenceListgetProfilesList(fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of profilesList<fr.paris.lutece.portal.business.right.Right>getRightsListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of rights associated to the profileList<fr.paris.lutece.portal.business.rbac.RBACRole>getRolesListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of roles associated to the profileList<fr.paris.lutece.portal.business.user.AdminUser>getUsersListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of users associated to the profilegetViewForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the view associated to the profileList<fr.paris.lutece.portal.business.workgroup.AdminWorkgroup>getWorkgroupsListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of workgroups associated to the profilebooleanhasProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the given user has a given profile or notbooleanhasRight(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile has the given right.booleanhasRole(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile has the given role.booleanCheck if a profile has the given user.booleanhasWorkgroup(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile has the given workgroup.voidRemove the Profile whose identifier is specified in parametervoidremoveProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove all profiles associated to an uservoidremoveRightFromProfile(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a right from a profilevoidremoveRights(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove all rights from profilevoidremoveRoleFromProfile(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a role from a profilevoidremoveRoles(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove all roles from profilevoidremoveUserFromProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a user from a profilevoidremoveUsers(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove all users from profilevoidremoveView(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove profile from a viewvoidremoveWorkgroupFromProfile(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a workgroup from a profilevoidremoveWorkgroups(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove all workgroups from profileUpdate of the profile which is specified in parameter
-
Constructor Details
-
ProfilesService
public ProfilesService()
-
-
Method Details
-
getListActions
public List<ProfileAction> getListActions(fr.paris.lutece.portal.business.user.AdminUser user, Profile profile, String strPermission, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of actions- Specified by:
getListActionsin interfaceIProfilesService- Parameters:
user- the current userprofile- the profilestrPermission- the permission namelocale- Localeplugin- Plugin- Returns:
- the list of actions
-
doAssignUserToProfile
public void doAssignUserToProfile(int nIdUser, javax.servlet.http.HttpServletRequest request, Locale locale) Do assign user to a profile- Specified by:
doAssignUserToProfilein interfaceIProfilesService- Parameters:
nIdUser- the id suerrequest- the HTTP requestlocale- the Locale
-
doUnassignUserFromProfile
public void doUnassignUserFromProfile(int nIdUser, String strProfileKey, fr.paris.lutece.portal.business.user.AdminUser currentUser, javax.servlet.http.HttpServletRequest request, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Do unassign user from profile- Specified by:
doUnassignUserFromProfilein interfaceIProfilesService- Parameters:
nIdUser- the id userstrProfileKey- the profile keycurrentUser- the current userrequest- the HTTP requestlocale- the localeplugin- the plugin
-
create
public Profile create(Profile profile, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Creation of an instance of profile- Specified by:
createin interfaceIProfilesService- Parameters:
profile- The instance of the profile which contains the informations to storelocale- the Localeplugin- Plugin- Returns:
- The instance of profile which has been created with its primary key.
-
update
public Profile update(Profile profile, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update of the profile which is specified in parameter- Specified by:
updatein interfaceIProfilesService- Parameters:
profile- The instance of the profile which contains the new data to storelocale- the Localeplugin- Plugin- Returns:
- The instance of the profile which has been updated
-
remove
public void remove(String strProfileKey, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the Profile whose identifier is specified in parameter- Specified by:
removein interfaceIProfilesService- Parameters:
strProfileKey- The Profile object to removelocale- the Localeplugin- Plugin
-
findByPrimaryKey
public Profile findByPrimaryKey(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an instance of a profile whose identifier is specified in parameter- Specified by:
findByPrimaryKeyin interfaceIProfilesService- Parameters:
strProfileKey- The key of the profileplugin- Plugin- Returns:
- An instance of profile
-
findAll
Returns a collection of profiles objects- Specified by:
findAllin interfaceIProfilesService- Parameters:
plugin- Plugin- Returns:
- A collection of profiles
-
findProfilesByFilter
public List<Profile> findProfilesByFilter(ProfileFilter pFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find profile by filter- Specified by:
findProfilesByFilterin interfaceIProfilesService- Parameters:
pFilter- the Filterplugin- Plugin- Returns:
- List of profiles
-
checkExistProfile
public boolean checkExistProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile already exists or not- Specified by:
checkExistProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin- Returns:
- true if it already exists
-
getProfilesList
public fr.paris.lutece.util.ReferenceList getProfilesList(fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of profiles- Specified by:
getProfilesListin interfaceIProfilesService- Parameters:
plugin- Plugin- Returns:
- the list of profiles
-
checkProfileAttributed
public boolean checkProfileAttributed(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the profile is attributed to any user- Specified by:
checkProfileAttributedin interfaceIProfilesService- Parameters:
strProfileKey- the profile keyplugin- Plugin- Returns:
- true if it is attributed to at least one user, false otherwise
-
findProfileByIdUser
public List<Profile> findProfileByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the list of profiles by a given ID user- Specified by:
findProfileByIdUserin interfaceIProfilesService- Parameters:
nIdUser- the ID userplugin- Plugin- Returns:
- The list of profiles
-
getRightsListForProfile
public List<fr.paris.lutece.portal.business.right.Right> getRightsListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of rights associated to the profile- Specified by:
getRightsListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of Right
-
hasRight
public boolean hasRight(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile has the given right.- Specified by:
hasRightin interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrIdRight- The Right IDplugin- Plugin- Returns:
- true if the profile has the right, false otherwise
-
addRightForProfile
public void addRightForProfile(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a right for a profile- Specified by:
addRightForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrIdRight- The Right IDplugin- Plugin
-
removeRightFromProfile
public void removeRightFromProfile(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a right from a profile- Specified by:
removeRightFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrIdRight- The Right IDplugin- Plugin
-
removeRights
Remove all rights from profile- Specified by:
removeRightsin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
getWorkgroupsListForProfile
public List<fr.paris.lutece.portal.business.workgroup.AdminWorkgroup> getWorkgroupsListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of workgroups associated to the profile- Specified by:
getWorkgroupsListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of workgroups
-
hasWorkgroup
public boolean hasWorkgroup(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile has the given workgroup.- Specified by:
hasWorkgroupin interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrWorkgroupKey- The Workgroup keyplugin- Plugin- Returns:
- true if the profile has the workgroup, false otherwise
-
addWorkgroupForProfile
public void addWorkgroupForProfile(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a workgroup for a profile- Specified by:
addWorkgroupForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrWorkgroupKey- The WorkgroupKeyplugin- Plugin
-
removeWorkgroupFromProfile
public void removeWorkgroupFromProfile(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a workgroup from a profile- Specified by:
removeWorkgroupFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrWorkgroupKey- The Workgroup keyplugin- Plugin
-
removeWorkgroups
public void removeWorkgroups(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove all workgroups from profile- Specified by:
removeWorkgroupsin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
getRolesListForProfile
public List<fr.paris.lutece.portal.business.rbac.RBACRole> getRolesListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of roles associated to the profile- Specified by:
getRolesListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of roles
-
hasRole
public boolean hasRole(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile has the given role.- Specified by:
hasRolein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrRoleKey- The Role keyplugin- Plugin- Returns:
- true if the profile has the role, false otherwise
-
addRoleForProfile
public void addRoleForProfile(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a role for a profile- Specified by:
addRoleForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrRoleKey- The RoleKeyplugin- Plugin
-
removeRoleFromProfile
public void removeRoleFromProfile(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a role from a profile- Specified by:
removeRoleFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrRoleKey- The role keyplugin- Plugin
-
removeRoles
Remove all roles from profile- Specified by:
removeRolesin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
getUsersListForProfile
public List<fr.paris.lutece.portal.business.user.AdminUser> getUsersListForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of users associated to the profile- Specified by:
getUsersListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of users
-
hasUser
public boolean hasUser(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a profile has the given user.- Specified by:
hasUserin interfaceIProfilesService- Parameters:
strProfileKey- The profile KeynIdUser- The User IDplugin- Plugin- Returns:
- true if the profile has the user, false otherwise
-
addUserForProfile
public void addUserForProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add an user for a profile- Specified by:
addUserForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeynIdUser- The User IDplugin- Plugin
-
removeUserFromProfile
public void removeUserFromProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a user from a profile- Specified by:
removeUserFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The key of the profilenIdUser- The User IDplugin- Plugin
-
removeUsers
Remove all users from profile- Specified by:
removeUsersin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
removeProfilesFromUser
public void removeProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove all profiles associated to an user- Specified by:
removeProfilesFromUserin interfaceIProfilesService- Parameters:
nIdUser- The User IDplugin- Plugin
-
hasProfile
public boolean hasProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the given user has a given profile or not- Specified by:
hasProfilein interfaceIProfilesService- Parameters:
strProfileKey- The key of the profilenIdUser- the ID userplugin- Plugin- Returns:
- true if the user has the profile, false otherwise
-
getViewForProfile
public View getViewForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the view associated to the profile- Specified by:
getViewForProfilein interfaceIProfilesService- Parameters:
strProfileKey- the profile keyplugin- Plugin- Returns:
- the view
-
removeView
Remove profile from a view- Specified by:
removeViewin interfaceIProfilesService- Parameters:
strProfileKey- the profile keyplugin- Plugin