Package fr.paris.lutece.portal.web.rbac
Class RoleManagementJspBean
- java.lang.Object
-
- fr.paris.lutece.portal.web.admin.AdminFeaturesPageJspBean
-
- fr.paris.lutece.portal.web.rbac.RoleManagementJspBean
-
- All Implemented Interfaces:
java.io.Serializable
public class RoleManagementJspBean extends AdminFeaturesPageJspBean
This class provides methods for role management.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRIGHT_MANAGE_ROLESRight to manage RBAC
-
Constructor Summary
Constructors Constructor Description RoleManagementJspBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringdoAssignUsers(javax.servlet.http.HttpServletRequest request)Process the data capture form for assign users to a rolejava.lang.StringdoConfirmRemoveControlFromRole(javax.servlet.http.HttpServletRequest request)Get the confirmation page before deletion of a controljava.lang.StringdoConfirmRemoveRole(javax.servlet.http.HttpServletRequest request)Get the confirmation page before deletion of a rolejava.lang.StringdoCreateRole(javax.servlet.http.HttpServletRequest request)Perform the role creation.java.lang.StringdoModifyRole(javax.servlet.http.HttpServletRequest request)Performs the modification of the role's key and description.java.lang.StringdoRemoveControlFromRole(javax.servlet.http.HttpServletRequest request)Perform the role deletion.java.lang.StringdoRemoveRole(javax.servlet.http.HttpServletRequest request)Perform the role deletion.java.lang.StringdoSelectPermissions(javax.servlet.http.HttpServletRequest request)Perform the checks on the permission selection and redirects to the description of the role if ok.java.lang.StringdoSelectResources(javax.servlet.http.HttpServletRequest request)Perform the checks on the resource selection method and perform the suitable redirection.java.lang.StringdoSelectResourcesFromIdsList(javax.servlet.http.HttpServletRequest request)Perform the check on the resource id list selected on the specific id selection page perform the suitable redirection.java.lang.StringdoUnAssignUser(javax.servlet.http.HttpServletRequest request)unassigns user from rolejava.lang.StringgetAddControlToRole(javax.servlet.http.HttpServletRequest request)Get the first page of the control addition to a role.java.lang.StringgetAssignUsers(javax.servlet.http.HttpServletRequest request)Returns the users assignation formjava.lang.StringgetCreateRole(javax.servlet.http.HttpServletRequest request)Get the role creation page.java.lang.StringgetManageRoles(javax.servlet.http.HttpServletRequest request)Get the roles management page.java.lang.StringgetSelectPermissions(javax.servlet.http.HttpServletRequest request)Get the permission selection page.java.lang.StringgetSelectSpecificIds(javax.servlet.http.HttpServletRequest request)Get the list of ids corresponding to the current resource type.java.lang.StringgetViewRoleDescription(javax.servlet.http.HttpServletRequest request)Get the page describing a role and the resource associated-
Methods inherited from class fr.paris.lutece.portal.web.admin.AdminFeaturesPageJspBean
getAdminPage, getAdminPage, getFeatureIcon, getHomeUrl, getLocale, getPageTitle, getUser, init, setFeatureGroup, setFeatureIcon, setPageTitleProperty, validate, validate, validate
-
-
-
-
Field Detail
-
RIGHT_MANAGE_ROLES
public static final java.lang.String RIGHT_MANAGE_ROLES
Right to manage RBAC- See Also:
- Constant Field Values
-
-
Method Detail
-
getManageRoles
public java.lang.String getManageRoles(javax.servlet.http.HttpServletRequest request)
Get the roles management page. This page provides the list of all existing roles.- Parameters:
request- the http request- Returns:
- the html code for the role management page
-
getCreateRole
public java.lang.String getCreateRole(javax.servlet.http.HttpServletRequest request)
Get the role creation page. This page provides a form to enter basic information about the new role.- Parameters:
request- the http request- Returns:
- the html code for the role creation page
-
doCreateRole
public java.lang.String doCreateRole(javax.servlet.http.HttpServletRequest request) throws AccessDeniedExceptionPerform the role creation. The role key entered should not already exist. The role key is mandatory.- Parameters:
request- the http request- Returns:
- the url to forward to
- Throws:
AccessDeniedException- if the security token is invalid
-
doModifyRole
public java.lang.String doModifyRole(javax.servlet.http.HttpServletRequest request) throws AccessDeniedExceptionPerforms the modification of the role's key and description. The role key entered should not already exist. The role key is mandatory. It should update the key for all the entries in the role-resource association list.- Parameters:
request- the http request- Returns:
- the url to forward to
- Throws:
AccessDeniedException- if the security token is invalid
-
doConfirmRemoveRole
public java.lang.String doConfirmRemoveRole(javax.servlet.http.HttpServletRequest request)
Get the confirmation page before deletion of a role- Parameters:
request- the HTTP request- Returns:
- the url of the confirmation page
-
doRemoveRole
public java.lang.String doRemoveRole(javax.servlet.http.HttpServletRequest request) throws AccessDeniedExceptionPerform the role deletion. Also delete the resources linked to this role- Parameters:
request- the http request- Returns:
- the url of the role management page
- Throws:
AccessDeniedException- if the security token is invalid
-
getViewRoleDescription
public java.lang.String getViewRoleDescription(javax.servlet.http.HttpServletRequest request)
Get the page describing a role and the resource associated- Parameters:
request- the HTTP request- Returns:
- the HTML code for the description page
-
doConfirmRemoveControlFromRole
public java.lang.String doConfirmRemoveControlFromRole(javax.servlet.http.HttpServletRequest request)
Get the confirmation page before deletion of a control- Parameters:
request- the http request- Returns:
- the url of the confirmation page
-
doRemoveControlFromRole
public java.lang.String doRemoveControlFromRole(javax.servlet.http.HttpServletRequest request) throws AccessDeniedExceptionPerform the role deletion. Also delete the resources linked to this role- Parameters:
request- the http request- Returns:
- the url of the role management page
- Throws:
AccessDeniedException- if the security token is invalid
-
getAddControlToRole
public java.lang.String getAddControlToRole(javax.servlet.http.HttpServletRequest request)
Get the first page of the control addition to a role. This page provides choice for resource selection. 2 methods are provided :- wildcard selection : all resources of this type are selected.
- specific selection : a page with the list of resource ids available is provided next for user choice.
- Parameters:
request- the HTTP request- Returns:
- the HTML content for the resource selection method choice
-
doSelectResources
public java.lang.String doSelectResources(javax.servlet.http.HttpServletRequest request)
Perform the checks on the resource selection method and perform the suitable redirection.- If selection method is global (wilcard selection - parameter "all"), the user is redirected to the permission selection page.
- If selection method is specific (id selection - parameter "choose"), the user is redirected to the resource id selection page.
- If no selection method is found, or if it's neither parameter "all" nor "choose", the user is redirected to a error page.
- Parameters:
request- the http request- Returns:
- the url of the page to be redirected to
-
getSelectSpecificIds
public java.lang.String getSelectSpecificIds(javax.servlet.http.HttpServletRequest request)
Get the list of ids corresponding to the current resource type. This allows to provide the selection of resource ids that should be controlled for the current role.- Parameters:
request- the http request- Returns:
- the html code for the list of ids to select
-
doSelectResourcesFromIdsList
public java.lang.String doSelectResourcesFromIdsList(javax.servlet.http.HttpServletRequest request)
Perform the check on the resource id list selected on the specific id selection page perform the suitable redirection.- If selection method is specific (id selection - parameter "choose"),
- if at least one id as been selected, the user is redirected to the permission selection page.
- if no id as been selected, the user is redirected to an error page.
- If selection method is global (wilcard selection - parameter "all"), the user is redirected to the permission selection page (This check could be avoided as is should not happen).
- If no selection method is found, or if it's neither parameter "all" nor "choose", the user is redirected to a error page.
- Parameters:
request- the http request- Returns:
- the url of the page to be redirected to
- If selection method is specific (id selection - parameter "choose"),
-
getSelectPermissions
public java.lang.String getSelectPermissions(javax.servlet.http.HttpServletRequest request)
Get the permission selection page. 2 methods are provided :- wildcard selection : all permissions for this type are selected.
- specific selection : the choice is to be made by the user in the list of available permissions.
- Parameters:
request- the http request- Returns:
- the html code for the permission selection page.
-
doSelectPermissions
public java.lang.String doSelectPermissions(javax.servlet.http.HttpServletRequest request) throws AccessDeniedExceptionPerform the checks on the permission selection and redirects to the description of the role if ok.- If selection method is global (wilcard selection - parameter "all"), the corresponding entry is stored as a control for all resources previously selected. The user is redirected to the role description page.
- If selection method is specific (id selection - parameter "choose"),
- if no permission is found, the user is redirected to an error page.
- if at least one permission is found, the corresponding entry is stored as a control for all resources previously selected. The user is redirected to the role description page.
- If no selection method is found, or if it's neither parameter "all" nor "choose", the user is redirected to a error page.
- Parameters:
request- the http request- Returns:
- the url of the page to be redirected to
- Throws:
AccessDeniedException- if the security token is invalid
-
getAssignUsers
public java.lang.String getAssignUsers(javax.servlet.http.HttpServletRequest request)
Returns the users assignation form- Parameters:
request- The Http request- Returns:
- the html code for display the modes list
-
doAssignUsers
public java.lang.String doAssignUsers(javax.servlet.http.HttpServletRequest request) throws AccessDeniedExceptionProcess the data capture form for assign users to a role- Parameters:
request- The HTTP Request- Returns:
- The Jsp URL of the process result
- Throws:
AccessDeniedException- if the security token is invalid
-
doUnAssignUser
public java.lang.String doUnAssignUser(javax.servlet.http.HttpServletRequest request) throws AccessDeniedExceptionunassigns user from role- Parameters:
request- The HttpRequest- Returns:
- the HTML code of list assignations
- Throws:
AccessDeniedException- if the security token is invalid
-
-