Interface ViewAuthorizer
- All Known Implementing Classes:
DocumentViewAuthorizerBase,InquiryViewAuthorizerBase,LookupViewAuthorizerBase,MaintenanceViewAuthorizerBase,TransactionalDocumentViewAuthorizerBase,ViewAuthorizerBase
View
Note only user authorization is done by the authorizer class. For non-user based logic, use the
ViewPresentationController
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanEditField(View view, ViewModel model, Field field, String propertyName, org.kuali.rice.kim.api.identity.Person user) booleancanEditGroup(View view, ViewModel model, Group group, String groupId, org.kuali.rice.kim.api.identity.Person user) booleancanEditLine(View view, ViewModel model, CollectionGroup collectionGroup, String collectionPropertyName, Object line, org.kuali.rice.kim.api.identity.Person user) booleancanEditLineField(View view, ViewModel model, CollectionGroup collectionGroup, String collectionPropertyName, Object line, Field field, String propertyName, org.kuali.rice.kim.api.identity.Person user) booleancanEditView(View view, ViewModel model, org.kuali.rice.kim.api.identity.Person user) Determines if the given user is authorized to edit the given viewbooleancanEditWidget(View view, ViewModel model, Widget widget, String widgetId, org.kuali.rice.kim.api.identity.Person user) booleancanOpenView(View view, ViewModel model, org.kuali.rice.kim.api.identity.Person user) Determines if the given user is authorized to open the given viewbooleancanPartialUnmaskField(View view, ViewModel model, DataField field, String propertyName, org.kuali.rice.kim.api.identity.Person user) Checks whether the partial mask authorization exists for the given property and if so whether the given user has the ability to unmask the valuebooleancanPerformAction(View view, ViewModel model, Action action, String actionEvent, String actionId, org.kuali.rice.kim.api.identity.Person user) booleancanPerformLineAction(View view, ViewModel model, CollectionGroup collectionGroup, String collectionPropertyName, Object line, Action action, String actionEvent, String actionId, org.kuali.rice.kim.api.identity.Person user) booleancanUnmaskField(View view, ViewModel model, DataField field, String propertyName, org.kuali.rice.kim.api.identity.Person user) Checks whether the mask authorization exists for the given property and if so whether the given user has the ability to unmask the valuebooleancanViewField(View view, ViewModel model, Field field, String propertyName, org.kuali.rice.kim.api.identity.Person user) booleancanViewGroup(View view, ViewModel model, Group group, String groupId, org.kuali.rice.kim.api.identity.Person user) booleancanViewLine(View view, ViewModel model, CollectionGroup collectionGroup, String collectionPropertyName, Object line, org.kuali.rice.kim.api.identity.Person user) booleancanViewLineField(View view, ViewModel model, CollectionGroup collectionGroup, String collectionPropertyName, Object line, Field field, String propertyName, org.kuali.rice.kim.api.identity.Person user) booleancanViewWidget(View view, ViewModel model, Widget widget, String widgetId, org.kuali.rice.kim.api.identity.Person user) getActionFlags(View view, ViewModel model, org.kuali.rice.kim.api.identity.Person user, Set<String> actions) Returns the set of action flags that are authorized for the given usergetEditModes(View view, ViewModel model, org.kuali.rice.kim.api.identity.Person user, Set<String> editModes) Returns the set of edit modes that are authorized for the given uservoidsetRequestAuthorizationCache(RequestAuthorizationCache requestAuthorizationCache)
-
Method Details
-
getActionFlags
Set<String> getActionFlags(View view, ViewModel model, org.kuali.rice.kim.api.identity.Person user, Set<String> actions) Returns the set of action flags that are authorized for the given userAction flags are created for views to indicate some action or feature should be enabled. These flags can be used within expressions for configuring the view content. For example: invalid input: '<'bean parent="Action" p:methodToCall="save" p:actionLabel="save" p:render="@{#actionFlags[#Constants.KUALI_ACTION_CAN_SAVE]}"/>
For each action flag, KIM is consulted to determine if a permission exist for the template associated with the action flag. If so, a check is then made to determine if the user has that permission. If the permission fails for the user, the action flag is removed from the returned set.
The Set of available action flags should first be exported by the
ViewPresentationController.getActionFlags(View, org.kuali.rice.krad.web.form.UifFormBase)method. The set returned from this method will be passed as the method argument here by the framework.- Parameters:
view- - view instance the action flags apply tomodel- - object containing the view datauser- - user we are authorizing the actions foractions- - set of action flags to authorize- Returns:
- Set<String> set of action flags that have been authorized, this will be equal to or a subset of the actions passed in
-
getEditModes
Set<String> getEditModes(View view, ViewModel model, org.kuali.rice.kim.api.identity.Person user, Set<String> editModes) Returns the set of edit modes that are authorized for the given userAn edit mode is a string that identifies a set of editable fields within the view. These are generally used when the entire view is not editable, but only certain fields. A field can be associated with an edit mode in two ways. The first is by using the edit mode in an expression when setting the field readOnly property. For example: <property name="readOnly" value="@{!#editModes['specialEdit'] and !fullEdit}" /> The second way is with the
ViewPresentationController.canEditField(View, ViewModel, org.kuali.rice.krad.uif.field.Field, String)method which can look at the edit modes map on the view to determine if the given field should be editable.For each edit mode, KIM is consulted to determine if a permission exist for the 'Use View' template and the edit mode detail. If so, a check is then made to determine if the user has that permission. If the permission fails for the user, the edit mode is removed from the returned set.
The Set of available edit modes should first be exported by the
ViewPresentationController.getEditModes(View, org.kuali.rice.krad.web.form.UifFormBase)method. The set returned from this method will be passed as the method argument here by the framework.- Parameters:
view- - view instance the edit modes apply tomodel- - object containing the view datauser- - user we are authorizing the actions foreditModes- - set of edit modes to authorize- Returns:
- Set<String> set of edit modes that have been authorized, this will be equal to or a subset of the edit mode set passed in
-
canOpenView
Determines if the given user is authorized to open the given view- Parameters:
view- - view instance to check authorization formodel- - object containing the view datauser- - user to authorize- Returns:
- boolean true if the user is authorized to open the view, false otherwise
-
canEditView
Determines if the given user is authorized to edit the given view- Parameters:
view- - view instance to check authorization formodel- - object containing the view datauser- - user to authorize- Returns:
- boolean true if the user is authorized to edit the view, false otherwise
-
canUnmaskField
boolean canUnmaskField(View view, ViewModel model, DataField field, String propertyName, org.kuali.rice.kim.api.identity.Person user) Checks whether the mask authorization exists for the given property and if so whether the given user has the ability to unmask the value- Parameters:
view- - view instance the field belongs tomodel- - object containing the view datafield- - field associated for the property and from which theComponentSecuritywill be retrievedpropertyName- - name of the property associated with the fielduser- - user we are authorizing- Returns:
- boolean true if the value can be unmasked, false if it should be masked
-
canPartialUnmaskField
boolean canPartialUnmaskField(View view, ViewModel model, DataField field, String propertyName, org.kuali.rice.kim.api.identity.Person user) Checks whether the partial mask authorization exists for the given property and if so whether the given user has the ability to unmask the value- Parameters:
view- - view instance the field belongs tomodel- - object containing the view datafield- - field associated for the property and from which theComponentSecuritywill be retrievedpropertyName- - name of the property associated with the fielduser- - user we are authorizing- Returns:
- boolean true if the value can be unmasked, false if it should be partially masked
-
canEditField
-
canViewField
-
canEditGroup
-
canViewGroup
-
canEditWidget
-
canViewWidget
-
canPerformAction
-
canEditLine
boolean canEditLine(View view, ViewModel model, CollectionGroup collectionGroup, String collectionPropertyName, Object line, org.kuali.rice.kim.api.identity.Person user) -
canViewLine
boolean canViewLine(View view, ViewModel model, CollectionGroup collectionGroup, String collectionPropertyName, Object line, org.kuali.rice.kim.api.identity.Person user) -
canEditLineField
-
canViewLineField
-
canPerformLineAction
-
setRequestAuthorizationCache
-