Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
package fr.paris.lutece.plugins.profiles.business;

import fr.paris.lutece.plugins.profiles.business.views.View;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.rbac.RBACRole;
import fr.paris.lutece.portal.business.right.Right;
import fr.paris.lutece.portal.business.user.AdminUser;
import fr.paris.lutece.portal.business.workgroup.AdminWorkgroup;
Expand Down Expand Up @@ -284,7 +284,7 @@ public interface IProfileDAO
* Plugin
* @return The list of roles
*/
List<AdminRole> selectRolesListForProfile( String strProfileKey, Plugin plugin );
List<RBACRole> selectRolesListForProfile( String strProfileKey, Plugin plugin );

/**
* Check if a profile has the given role.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

import fr.paris.lutece.plugins.profiles.business.views.View;
import fr.paris.lutece.plugins.profiles.utils.constants.ProfilesConstants;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.rbac.RBACRole;
import fr.paris.lutece.portal.business.right.Right;
import fr.paris.lutece.portal.business.user.AdminUser;
import fr.paris.lutece.portal.business.workgroup.AdminWorkgroup;
Expand Down Expand Up @@ -483,9 +483,9 @@ public void deleteWorkgroups( String strProfileKey, Plugin plugin )
* {@inheritDoc}
*/
@Override
public List<AdminRole> selectRolesListForProfile( String strProfileKey, Plugin plugin )
public List<RBACRole> selectRolesListForProfile( String strProfileKey, Plugin plugin )
{
List<AdminRole> listRoles = new ArrayList<AdminRole>( );
List<RBACRole> listRoles = new ArrayList<RBACRole>( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_ROLES_LIST_FOR_PROFILE, plugin );

daoUtil.setString( 1, strProfileKey );
Expand All @@ -494,7 +494,7 @@ public List<AdminRole> selectRolesListForProfile( String strProfileKey, Plugin p

while ( daoUtil.next( ) )
{
AdminRole role = new AdminRole( );
RBACRole role = new RBACRole( );
role.setKey( daoUtil.getString( 1 ) );

listRoles.add( role );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
package fr.paris.lutece.plugins.profiles.business;

import fr.paris.lutece.plugins.profiles.business.views.View;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.rbac.RBACRole;
import fr.paris.lutece.portal.business.right.Right;
import fr.paris.lutece.portal.business.user.AdminUser;
import fr.paris.lutece.portal.business.workgroup.AdminWorkgroup;
Expand Down Expand Up @@ -364,7 +364,7 @@ public static void removeWorkgroups( String strProfileKey, Plugin plugin )
* Plugin
* @return The list of roles
*/
public static List<AdminRole> getRolesListForProfile( String strProfileKey, Plugin plugin )
public static List<RBACRole> getRolesListForProfile( String strProfileKey, Plugin plugin )
{
return _dao.selectRolesListForProfile( strProfileKey, plugin );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
package fr.paris.lutece.plugins.profiles.business;

import fr.paris.lutece.plugins.profiles.service.ProfilesPlugin;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.rbac.AdminRoleHome;
import fr.paris.lutece.portal.business.rbac.RBACRole;
import fr.paris.lutece.portal.business.rbac.RBACRoleHome;
import fr.paris.lutece.portal.business.right.Right;
import fr.paris.lutece.portal.business.right.RightHome;
import fr.paris.lutece.portal.business.user.AdminUser;
Expand Down Expand Up @@ -86,9 +86,9 @@ public void doCreateUserFields( AdminUser user, List<AdminUserField> listUserFie
}

// Add roles to the user
for ( AdminRole role : ProfileHome.getRolesListForProfile( strProfileKey, plugin ) )
for ( RBACRole role : ProfileHome.getRolesListForProfile( strProfileKey, plugin ) )
{
role = AdminRoleHome.findByPrimaryKey( role.getKey( ) );
role = RBACRoleHome.findByPrimaryKey( role.getKey( ) );

if ( !AdminUserHome.hasRole( user, role.getKey( ) ) )
{
Expand Down Expand Up @@ -143,9 +143,9 @@ public void doModifyUserFields( AdminUser user, List<AdminUserField> listUserFie
}

// Remove roles to the user
for ( AdminRole role : ProfileHome.getRolesListForProfile( strKey, plugin ) )
for ( RBACRole role : ProfileHome.getRolesListForProfile( strKey, plugin ) )
{
role = AdminRoleHome.findByPrimaryKey( role.getKey( ) );
role = RBACRoleHome.findByPrimaryKey( role.getKey( ) );

if ( AdminUserHome.hasRole( user, role.getKey( ) ) )
{
Expand Down Expand Up @@ -188,9 +188,9 @@ public void doModifyUserFields( AdminUser user, List<AdminUserField> listUserFie
}

// Add roles to the user
for ( AdminRole role : ProfileHome.getRolesListForProfile( strProfileKey, plugin ) )
for ( RBACRole role : ProfileHome.getRolesListForProfile( strProfileKey, plugin ) )
{
role = AdminRoleHome.findByPrimaryKey( role.getKey( ) );
role = RBACRoleHome.findByPrimaryKey( role.getKey( ) );

if ( role != null && !AdminUserHome.hasRole( user, role.getKey( ) ) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import fr.paris.lutece.plugins.profiles.business.ProfileAction;
import fr.paris.lutece.plugins.profiles.business.ProfileFilter;
import fr.paris.lutece.plugins.profiles.business.views.View;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.rbac.RBACRole;
import fr.paris.lutece.portal.business.right.Right;
import fr.paris.lutece.portal.business.user.AdminUser;
import fr.paris.lutece.portal.business.workgroup.AdminWorkgroup;
Expand Down Expand Up @@ -365,7 +365,7 @@ public interface IProfilesService
* Plugin
* @return The list of roles
*/
List<AdminRole> getRolesListForProfile( String strProfileKey, Plugin plugin );
List<RBACRole> getRolesListForProfile( String strProfileKey, Plugin plugin );

/**
* Check if a profile has the given role.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import fr.paris.lutece.plugins.profiles.business.views.View;
import fr.paris.lutece.plugins.profiles.service.action.IProfileActionService;
import fr.paris.lutece.plugins.profiles.utils.constants.ProfilesConstants;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.rbac.RBACRole;
import fr.paris.lutece.portal.business.right.Right;
import fr.paris.lutece.portal.business.user.AdminUser;
import fr.paris.lutece.portal.business.user.AdminUserHome;
Expand Down Expand Up @@ -166,7 +166,7 @@ public void doUnassignUserFromProfile( int nIdUser, String strProfileKey, AdminU

List<Profile> listProfiles = findProfileByIdUser( nIdUser, plugin );
Set<Right> listProfilesRights = new HashSet<Right>( );
Set<AdminRole> listProfilesRoles = new HashSet<AdminRole>( );
Set<RBACRole> listProfilesRoles = new HashSet<RBACRole>( );
Set<AdminWorkgroup> listProfilesWorkgroups = new HashSet<AdminWorkgroup>( );
for ( Profile profile : listProfiles )
{
Expand All @@ -189,7 +189,7 @@ public void doUnassignUserFromProfile( int nIdUser, String strProfileKey, AdminU
}

// Remove roles to the user
for ( AdminRole role : getRolesListForProfile( strProfileKey, plugin ) )
for ( RBACRole role : getRolesListForProfile( strProfileKey, plugin ) )
{
if ( !listProfilesRoles.contains( role ) && AdminUserHome.hasRole( user, role.getKey( ) ) )
{
Expand Down Expand Up @@ -462,7 +462,7 @@ public void removeWorkgroups( String strProfileKey, Plugin plugin )
* {@inheritDoc}
*/
@Override
public List<AdminRole> getRolesListForProfile( String strProfileKey, Plugin plugin )
public List<RBACRole> getRolesListForProfile( String strProfileKey, Plugin plugin )
{
return ProfileHome.getRolesListForProfile( strProfileKey, plugin );
}
Expand Down
22 changes: 11 additions & 11 deletions src/java/fr/paris/lutece/plugins/profiles/web/ProfilesJspBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
import fr.paris.lutece.plugins.profiles.service.action.IProfileActionService;
import fr.paris.lutece.plugins.profiles.service.views.IViewsService;
import fr.paris.lutece.plugins.profiles.utils.constants.ProfilesConstants;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.rbac.AdminRoleHome;
import fr.paris.lutece.portal.business.rbac.RBAC;
import fr.paris.lutece.portal.business.rbac.RBACRole;
import fr.paris.lutece.portal.business.rbac.RBACRoleHome;
import fr.paris.lutece.portal.business.right.Level;
import fr.paris.lutece.portal.business.right.LevelHome;
import fr.paris.lutece.portal.business.right.Right;
Expand Down Expand Up @@ -868,11 +868,11 @@ public String getAssignRolesProfile( HttpServletRequest request )
Profile profile = _profilesService.findByPrimaryKey( strProfileKey, getPlugin( ) );

// ASSIGNED ROLES
List<AdminRole> listAssignedRoles = new ArrayList<AdminRole>( );
List<RBACRole> listAssignedRoles = new ArrayList<RBACRole>( );

for ( AdminRole role : _profilesService.getRolesListForProfile( strProfileKey, getPlugin( ) ) )
for ( RBACRole role : _profilesService.getRolesListForProfile( strProfileKey, getPlugin( ) ) )
{
role = AdminRoleHome.findByPrimaryKey( role.getKey( ) );
role = RBACRoleHome.findByPrimaryKey( role.getKey( ) );

if ( role != null )
{
Expand All @@ -885,14 +885,14 @@ public String getAssignRolesProfile( HttpServletRequest request )
ReferenceItem itemRole = null;
boolean bAssigned;

for ( AdminRole role : AdminRoleHome.findAll( ) )
for ( RBACRole role : RBACRoleHome.findAll( ) )
{
itemRole = new ReferenceItem( );
itemRole.setCode( role.getKey( ) );
itemRole.setName( role.getKey( ) );
bAssigned = false;

for ( AdminRole assignedRole : listAssignedRoles )
for ( RBACRole assignedRole : listAssignedRoles )
{
if ( assignedRole.getKey( ).equals( itemRole.getCode( ) ) )
{
Expand Down Expand Up @@ -947,8 +947,8 @@ public String getAssignRolesProfile( HttpServletRequest request )
// PAGINATOR
url.addParameter( ProfilesConstants.PARAMETER_PROFILE_KEY, profile.getKey( ) );

LocalizedPaginator<AdminRole> paginator = new LocalizedPaginator<AdminRole>( listAssignedRoles, _nItemsPerPage, url.getUrl( ),
Paginator.PARAMETER_PAGE_INDEX, _strCurrentPageIndex, getLocale( ) );
LocalizedPaginator<RBACRole> paginator = new LocalizedPaginator<RBACRole>( listAssignedRoles, _nItemsPerPage,
url.getUrl( ), Paginator.PARAMETER_PAGE_INDEX, _strCurrentPageIndex, getLocale( ) );

// PERMISSIONS
List<ProfileAction> listActions = _profilesService.getListActions( getUser( ), profile, strPermission, getLocale( ), getPlugin( ) );
Expand Down Expand Up @@ -1006,7 +1006,7 @@ public String doAssignRolesProfile( HttpServletRequest request )
_profilesService.addRoleForProfile( strProfileKey, arrayRoleIds [i], getPlugin( ) );

// Update users roles
AdminRole role = AdminRoleHome.findByPrimaryKey( arrayRoleIds [i] );
RBACRole role = RBACRoleHome.findByPrimaryKey( arrayRoleIds[i] );

for ( AdminUser user : _profilesService.getUsersListForProfile( strProfileKey, getPlugin( ) ) )
{
Expand Down Expand Up @@ -1048,7 +1048,7 @@ public String doUnassignRoleProfile( HttpServletRequest request )
_profilesService.removeRoleFromProfile( strProfileKey, strRoleKey, getPlugin( ) );

// Update users roles
AdminRole role = AdminRoleHome.findByPrimaryKey( strRoleKey );
RBACRole role = RBACRoleHome.findByPrimaryKey( strRoleKey );

for ( AdminUser user : _profilesService.getUsersListForProfile( strProfileKey, getPlugin( ) ) )
{
Expand Down