Class ProfilesService

java.lang.Object
fr.paris.lutece.plugins.profiles.service.ProfilesService
All Implemented Interfaces:
IProfilesService

@ApplicationScoped public class ProfilesService extends Object implements IProfilesService
ProfilesService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addRightForProfile(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Add a right for a profile
    void
    addRoleForProfile(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Add a role for a profile
    void
    addUserForProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Add an user for a profile
    void
    addWorkgroupForProfile(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Add a workgroup for a profile
    boolean
    checkExistProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if a profile already exists or not
    boolean
    checkProfileAttributed(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if the profile is attributed to any user
    create(Profile profile, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Creation of an instance of profile
    void
    doAssignUserToProfile(int nIdUser, jakarta.servlet.http.HttpServletRequest request, Locale locale)
    Do assign user to a profile
    void
    doUnassignUserFromProfile(int nIdUser, String strProfileKey, fr.paris.lutece.portal.business.user.AdminUser currentUser, jakarta.servlet.http.HttpServletRequest request, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Do unassign user from profile
    findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns a collection of profiles objects
    findByPrimaryKey(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns an instance of a profile whose identifier is specified in parameter
    findProfileByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the list of profiles by a given ID user
    findProfilesByFilter(ProfileFilter pFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Find profile by filter
    fr.paris.lutece.util.html.ItemNavigator
    getItemNavigator(ProfileFilter pFilter, Profile profile, fr.paris.lutece.util.url.UrlItem url)
    Get the item navigator
    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
    fr.paris.lutece.util.ReferenceList
    getProfilesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Get the list of profiles
    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
    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
    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
    getViewForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Get the view associated to the profile
    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
    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
    boolean
    hasRight(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if a profile has the given right.
    boolean
    hasRole(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if a profile has the given role.
    boolean
    hasUser(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if a profile has the given user.
    boolean
    hasWorkgroup(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if a profile has the given workgroup.
    void
    remove(String strProfileKey, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove the Profile whose identifier is specified in parameter
    void
    removeProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove all profiles associated to an user
    void
    removeRightFromProfile(String strProfileKey, String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove a right from a profile
    void
    removeRights(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove all rights from profile
    void
    removeRoleFromProfile(String strProfileKey, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove a role from a profile
    void
    removeRoles(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove all roles from profile
    void
    removeUserFromProfile(String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove a user from a profile
    void
    removeUsers(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove all users from profile
    void
    removeView(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove profile from a view
    void
    removeWorkgroupFromProfile(String strProfileKey, String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove a workgroup from a profile
    void
    removeWorkgroups(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove all workgroups from profile
    update(Profile profile, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update of the profile which is specified in parameter

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProfilesService

      public ProfilesService()
  • Method Details

    • getItemNavigator

      public fr.paris.lutece.util.html.ItemNavigator getItemNavigator(ProfileFilter pFilter, Profile profile, fr.paris.lutece.util.url.UrlItem url)
      Get the item navigator
      Specified by:
      getItemNavigator in interface IProfilesService
      Parameters:
      pFilter - the profile filter
      profile - the profile
      url - the url
      Returns:
      the item navigator
    • 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:
      getListActions in interface IProfilesService
      Parameters:
      user - the current user
      profile - the profile
      strPermission - the permission name
      locale - Locale
      plugin - Plugin
      Returns:
      the list of actions
    • doAssignUserToProfile

      public void doAssignUserToProfile(int nIdUser, jakarta.servlet.http.HttpServletRequest request, Locale locale)
      Do assign user to a profile
      Specified by:
      doAssignUserToProfile in interface IProfilesService
      Parameters:
      nIdUser - the id suer
      request - the HTTP request
      locale - the Locale
    • doUnassignUserFromProfile

      public void doUnassignUserFromProfile(int nIdUser, String strProfileKey, fr.paris.lutece.portal.business.user.AdminUser currentUser, jakarta.servlet.http.HttpServletRequest request, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Do unassign user from profile
      Specified by:
      doUnassignUserFromProfile in interface IProfilesService
      Parameters:
      nIdUser - the id user
      strProfileKey - the profile key
      currentUser - the current user
      request - the HTTP request
      locale - the locale
      plugin - 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:
      create in interface IProfilesService
      Parameters:
      profile - The instance of the profile which contains the informations to store
      locale - the Locale
      plugin - 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:
      update in interface IProfilesService
      Parameters:
      profile - The instance of the profile which contains the new data to store
      locale - the Locale
      plugin - 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:
      remove in interface IProfilesService
      Parameters:
      strProfileKey - The Profile object to remove
      locale - the Locale
      plugin - 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:
      findByPrimaryKey in interface IProfilesService
      Parameters:
      strProfileKey - The key of the profile
      plugin - Plugin
      Returns:
      An instance of profile
    • findAll

      public List<Profile> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns a collection of profiles objects
      Specified by:
      findAll in interface IProfilesService
      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:
      findProfilesByFilter in interface IProfilesService
      Parameters:
      pFilter - the Filter
      plugin - 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:
      checkExistProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile key
      plugin - 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:
      getProfilesList in interface IProfilesService
      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:
      checkProfileAttributed in interface IProfilesService
      Parameters:
      strProfileKey - the profile key
      plugin - 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:
      findProfileByIdUser in interface IProfilesService
      Parameters:
      nIdUser - the ID user
      plugin - 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:
      getRightsListForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      plugin - 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:
      hasRight in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strIdRight - The Right ID
      plugin - 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:
      addRightForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strIdRight - The Right ID
      plugin - 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:
      removeRightFromProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strIdRight - The Right ID
      plugin - Plugin
    • removeRights

      public void removeRights(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove all rights from profile
      Specified by:
      removeRights in interface IProfilesService
      Parameters:
      strProfileKey - The profile key
      plugin - 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:
      getWorkgroupsListForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      plugin - 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:
      hasWorkgroup in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strWorkgroupKey - The Workgroup key
      plugin - 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:
      addWorkgroupForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strWorkgroupKey - The WorkgroupKey
      plugin - 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:
      removeWorkgroupFromProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strWorkgroupKey - The Workgroup key
      plugin - Plugin
    • removeWorkgroups

      public void removeWorkgroups(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove all workgroups from profile
      Specified by:
      removeWorkgroups in interface IProfilesService
      Parameters:
      strProfileKey - The profile key
      plugin - 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:
      getRolesListForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      plugin - 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:
      hasRole in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strRoleKey - The Role key
      plugin - 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:
      addRoleForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strRoleKey - The RoleKey
      plugin - 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:
      removeRoleFromProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      strRoleKey - The role key
      plugin - Plugin
    • removeRoles

      public void removeRoles(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove all roles from profile
      Specified by:
      removeRoles in interface IProfilesService
      Parameters:
      strProfileKey - The profile key
      plugin - 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:
      getUsersListForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      plugin - 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:
      hasUser in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      nIdUser - The User ID
      plugin - 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:
      addUserForProfile in interface IProfilesService
      Parameters:
      strProfileKey - The profile Key
      nIdUser - The User ID
      plugin - 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:
      removeUserFromProfile in interface IProfilesService
      Parameters:
      strProfileKey - The key of the profile
      nIdUser - The User ID
      plugin - Plugin
    • removeUsers

      public void removeUsers(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove all users from profile
      Specified by:
      removeUsers in interface IProfilesService
      Parameters:
      strProfileKey - The profile key
      plugin - Plugin
    • removeProfilesFromUser

      public void removeProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove all profiles associated to an user
      Specified by:
      removeProfilesFromUser in interface IProfilesService
      Parameters:
      nIdUser - The User ID
      plugin - 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:
      hasProfile in interface IProfilesService
      Parameters:
      strProfileKey - The key of the profile
      nIdUser - the ID user
      plugin - 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:
      getViewForProfile in interface IProfilesService
      Parameters:
      strProfileKey - the profile key
      plugin - Plugin
      Returns:
      the view
    • removeView

      public void removeView(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove profile from a view
      Specified by:
      removeView in interface IProfilesService
      Parameters:
      strProfileKey - the profile key
      plugin - Plugin