public class AccountingLineAuthorizerBase extends Object implements AccountingLineAuthorizer
Modifier and Type | Field and Description |
---|---|
protected static String |
kfsImagePath |
protected static String |
riceImagePath |
Constructor and Description |
---|
AccountingLineAuthorizerBase() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
approvedForUnqualifiedEditing(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
boolean currentUserIsDocumentInitiator)
Determines if the given line is editable, no matter what a KIM check would say about line editability.
|
protected boolean |
determineEditPermissionByFieldName(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String fieldName,
org.kuali.rice.kim.api.identity.Person currentUser)
determine whether the current user has permission to edit the given field in the given accounting line
|
boolean |
determineEditPermissionOnField(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
String fieldName,
boolean editablePage)
Allows the overriding of whether a field on an accounting line is editable or not
|
boolean |
determineEditPermissionOnLine(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
boolean currentUserIsDocumentInitiator,
boolean pageIsEditable)
A hook to decide, pre-KIM check, if there's an edit permission on the given accounting line
|
protected String |
getActionInfixForExtantAccountingLine(AccountingLine accountingLine,
String accountingLinePropertyName)
Gets the "action infix" for the given accounting line which already exists on the document, so that the action knows it is
supposed to add to source vs.
|
protected String |
getActionInfixForNewAccountingLine(AccountingLine accountingLine,
String accountingLinePropertyName)
Gets the "action infix" for the given accounting line, so that the action knows it is supposed to add to source vs.
|
protected String |
getActionLabel(String messageKey,
Object... values)
get a label for an action with the specified message key and values
|
protected Map<String,AccountingLineViewAction> |
getActionMap(AccountingLineRenderingContext accountingLineRenderingContext,
String accountingLinePropertyName,
Integer accountingLineIndex,
String groupTitle)
collection the actions that are allowed for the given accounting line
|
List<AccountingLineViewAction> |
getActions(AccountingDocument accountingDocument,
AccountingLineRenderingContext accountingLineRenderingContext,
String accountingLinePropertyName,
Integer accountingLineIndex,
org.kuali.rice.kim.api.identity.Person currentUser,
String groupTitle)
Returns the basic actions - add for new lines, delete and balance inquiry for existing lines
|
protected AccountingLineViewAction |
getAddAction(AccountingLine accountingLine,
String accountingLinePropertyName,
String groupTitle)
construct the add action for the given accounting line, typically, a new accounting line
|
protected String |
getAddMethod(AccountingLine accountingLine,
String accountingLineProperty)
Builds the action method name of the method that adds accounting lines for this group
|
protected AccountingLineViewAction |
getBalanceInquiryAction(AccountingLine accountingLine,
String accountingLinePropertyName,
Integer accountingLineIndex,
String groupTitle)
construct the balance inquiry action for the given accounting line
|
protected String |
getBalanceInquiryMethod(AccountingLine accountingLine,
String accountingLineProperty,
Integer accountingLineIndex)
Builds the action method name of the method that performs a balance inquiry on accounting lines for this group
|
protected org.kuali.rice.core.api.config.property.ConfigurationService |
getConfigurationService() |
protected AccountingLineViewAction |
getDeleteAction(AccountingLine accountingLine,
String accountingLinePropertyName,
Integer accountingLineIndex,
String groupTitle)
construct the delete action for the given accounting line
|
protected String |
getDeleteLineMethod(AccountingLine accountingLine,
String accountingLineProperty,
Integer accountingLineIndex)
Builds the action method name of the method that deletes accounting lines for this group
|
protected org.kuali.rice.kns.document.authorization.DocumentAuthorizer |
getDocumentAuthorizer(AccountingDocument accountingDocument)
get the document authorizer of the given accounting document
|
protected String |
getFieldName(AccountingLineViewField field)
get the full property name of the given field
|
protected String |
getKFSImagePath() |
protected String |
getKimHappyPropertyNameForField(String convertedName) |
protected Map<String,String> |
getPermissionDetails(String documentTypeName,
String fieldName)
Gathers together all the information for a permission detail attribute set
|
protected String |
getRiceImagePath() |
protected Map<String,String> |
getRoleQualifiers(AccountingDocument accountingDocument,
AccountingLine accountingLine)
Gathers together the role qualifiers for the KIM perm call
|
Set<String> |
getUnviewableBlocks(AccountingDocument accountingDocument,
AccountingLine accountingLine,
boolean newLine,
org.kuali.rice.kim.api.identity.Person currentUser)
Returns a new empty HashSet
|
protected boolean |
hasEditPermission(AccountingDocument accountingDocument,
org.kuali.rice.kim.api.identity.Person currentUser,
Map<String,String> permissionDetails,
Map<String,String> roleQualifiers)
determine whether the current user has modification permission on an accounting line with the given qualifications.
|
boolean |
hasEditPermissionOnAccountingLine(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
org.kuali.rice.kim.api.identity.Person currentUser,
boolean pageIsEditable)
Determine whether the current user has permission to edit the given accounting line as a whole
|
boolean |
hasEditPermissionOnField(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
String fieldName,
boolean editableLine,
boolean editablePage,
org.kuali.rice.kim.api.identity.Person currentUser)
determine whether the current user has permission to edit the given field in the given accounting line
|
boolean |
isGroupEditable(AccountingDocument accountingDocument,
List<? extends AccountingLineRenderingContext> accountingLineRenderingContexts,
org.kuali.rice.kim.api.identity.Person currentUser)
Determines if any entire group is rendered as editable, which means that a new line will appear
|
protected boolean |
isMessageMapContainingErrorsOnLine(String accountingLinePropertyName)
Determines if the error map contains any errors which exist on the currently rendered accounting line
|
boolean |
renderNewLine(AccountingDocument accountingDocument,
String accountingGroupProperty)
Determines if new lines should be rendered for the given accounting line group (identified by its property name)
|
protected String |
replaceCollectionElementsWithPlurals(String name)
Replaces references to collection elements to their respective plural names WARNING: this method is totally lame and I for
one wished it didn't have to exist
|
protected String |
stripDocumentPrefixFromName(String name)
Strips "document." and everything before from the property name
|
protected static String riceImagePath
protected static String kfsImagePath
public AccountingLineAuthorizerBase()
public List<AccountingLineViewAction> getActions(AccountingDocument accountingDocument, AccountingLineRenderingContext accountingLineRenderingContext, String accountingLinePropertyName, Integer accountingLineIndex, org.kuali.rice.kim.api.identity.Person currentUser, String groupTitle)
getActions
in interface AccountingLineAuthorizer
accountingDocument
- the accounting document the line to authorize is owned byaccountingLineRenderingContext
- a renderable context wrapping the accounting line that is being authorized againstaccountingLinePropertyName
- the name of the property that represents the accounting lineaccountingLineIndex
- value, as Integer, of the index of the given accounting line within the group's collection of accounting
lines; if null, then it is assumed that this is a new linegroupTitle
- title of the group from the data dictionaryorg.kuali.ole.sys.document.authorization.AccountingLineAuthorizer#getActions(org.kuali.ole.sys.document.AccountingDocument,
org.kuali.ole.sys.businessobject.AccountingLine, java.lang.String, java.lang.Integer, org.kuali.rice.kim.api.identity.Person,
java.lang.String)
protected boolean isMessageMapContainingErrorsOnLine(String accountingLinePropertyName)
accountingLinePropertyName
- the property name of the accounting linepublic Set<String> getUnviewableBlocks(AccountingDocument accountingDocument, AccountingLine accountingLine, boolean newLine, org.kuali.rice.kim.api.identity.Person currentUser)
getUnviewableBlocks
in interface AccountingLineAuthorizer
accountingDocument
- the accounting document the line to authorize is owned byaccountingLine
- the accounting line that is being authorized againstnewLine
- whether the line is a new line or notorg.kuali.ole.sys.document.authorization.AccountingLineAuthorizer#getUnviewableBlocks(org.kuali.ole.sys.document.AccountingDocument,
org.kuali.ole.sys.businessobject.AccountingLine, java.lang.String, boolean)
public boolean renderNewLine(AccountingDocument accountingDocument, String accountingGroupProperty)
AccountingLineAuthorizer
renderNewLine
in interface AccountingLineAuthorizer
accountingDocument
- the document that has accounting lines being authorizedaccountingGroupProperty
- the property of this accounting groupAccountingLineAuthorizer.renderNewLine(org.kuali.ole.sys.document.AccountingDocument,
java.lang.String)
public boolean isGroupEditable(AccountingDocument accountingDocument, List<? extends AccountingLineRenderingContext> accountingLineRenderingContexts, org.kuali.rice.kim.api.identity.Person currentUser)
AccountingLineAuthorizer
isGroupEditable
in interface AccountingLineAuthorizer
accountingDocument
- the accounting document which the collection of line are onaccountingLineRenderingContexts
- the accounting lines of the group, wrapped in AccountingLineRenderingContext implementationscurrentUser
- the current userorg.kuali.ole.sys.document.authorization.AccountingLineAuthorizer#isGroupEditable(org.kuali.ole.sys.document.AccountingDocument,
java.lang.String, org.kuali.rice.kim.api.identity.Person)
protected Map<String,AccountingLineViewAction> getActionMap(AccountingLineRenderingContext accountingLineRenderingContext, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line grouppublic final boolean hasEditPermissionOnField(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, String fieldName, boolean editableLine, boolean editablePage, org.kuali.rice.kim.api.identity.Person currentUser)
hasEditPermissionOnField
in interface AccountingLineAuthorizer
accountingDocument
- the given accounting documentaccountingLine
- the given accounting line in the documentfieldName
- the name of a field in the given accounting lineeditableLine
- whether the parent line of this field is editableeditablePage
- whether the parent page of this field is editablecurrentUser
- the current useraccountingLineCollectionProperty
- the property of the collection the given accounting line is inpublic boolean determineEditPermissionOnField(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, String fieldName, boolean editablePage)
accountingDocument
- the accounting document the line to test is onaccountingLine
- the accounting line to testaccountingLineCollectionProperty
- the property that the accounting line lives infieldName
- the name of the field we are testingeditableLine
- whether the parent line of this field is editableeditablePage
- whether the parent page of this field is editablepublic final boolean hasEditPermissionOnAccountingLine(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, org.kuali.rice.kim.api.identity.Person currentUser, boolean pageIsEditable)
hasEditPermissionOnAccountingLine
in interface AccountingLineAuthorizer
accountingDocument
- the given accounting documentaccountingLine
- the given accounting line in the documentcurrentUser
- the current useraccountingLineCollectionProperty
- the property of the group that holds these accounting linespageIsEditable
- whether the current page is editable by the current user or notpublic boolean determineEditPermissionOnLine(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, boolean currentUserIsDocumentInitiator, boolean pageIsEditable)
accountingDocument
- the accounting document the line is or wants to be associated withaccountingLine
- the accounting line itselfaccountingLineCollectionProperty
- the collection the accounting line is or would be part ofcurrentUserIsDocumentInitiator
- is the current user the initiator of the document?protected boolean approvedForUnqualifiedEditing(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, boolean currentUserIsDocumentInitiator)
accountingDocument
- the accounting document the line is or wants to be associated withaccountingLine
- the accounting line itselfaccountingLineCollectionProperty
- the collection the accounting line is or would be part ofcurrentUserIsDocumentInitiator
- is the current user the initiator of the document?protected boolean determineEditPermissionByFieldName(AccountingDocument accountingDocument, AccountingLine accountingLine, String fieldName, org.kuali.rice.kim.api.identity.Person currentUser)
accountingDocument
- the given accounting documentaccountingLine
- the given accounting line in the documentfieldName
- the name of a field in the given accounting linecurrentUser
- the current userprotected boolean hasEditPermission(AccountingDocument accountingDocument, org.kuali.rice.kim.api.identity.Person currentUser, Map<String,String> permissionDetails, Map<String,String> roleQualifiers)
currentUser
- the current userpermissionDetails
- the given permission detailsroleQualifiers
- the given role qualificationsprotected Map<String,String> getPermissionDetails(String documentTypeName, String fieldName)
documentTypeName
- the documentfieldName
- the given field nameprotected final Map<String,String> getRoleQualifiers(AccountingDocument accountingDocument, AccountingLine accountingLine)
accountingLine
- the accounting line to get role qualifiers fromprotected String getKimHappyPropertyNameForField(String convertedName)
field
- AccountingLineViewField to find KIM-happy property name forprotected String getFieldName(AccountingLineViewField field)
field
- the field to get the name fromprotected String stripDocumentPrefixFromName(String name)
name
- the property name to strip the document portion off ofprotected String replaceCollectionElementsWithPlurals(String name)
name
- the property name with perhaps collection elements inprotected AccountingLineViewAction getBalanceInquiryAction(AccountingLine accountingLine, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line groupprotected AccountingLineViewAction getDeleteAction(AccountingLine accountingLine, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line groupprotected AccountingLineViewAction getAddAction(AccountingLine accountingLine, String accountingLinePropertyName, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line groupprotected String getActionLabel(String messageKey, Object... values)
messageKey
- the given message key that points to the labelvalues
- the given values that would be displayed in labelprotected String getAddMethod(AccountingLine accountingLine, String accountingLineProperty)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting lineprotected String getDeleteLineMethod(AccountingLine accountingLine, String accountingLineProperty, Integer accountingLineIndex)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting lineaccountingLineIndex
- the index of the given accounting line within the the group being renderedprotected String getBalanceInquiryMethod(AccountingLine accountingLine, String accountingLineProperty, Integer accountingLineIndex)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting lineaccountingLineIndex
- the index of the given accounting line within the the group being renderedprotected String getActionInfixForNewAccountingLine(AccountingLine accountingLine, String accountingLinePropertyName)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting lineprotected String getActionInfixForExtantAccountingLine(AccountingLine accountingLine, String accountingLinePropertyName)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting lineprotected org.kuali.rice.kns.document.authorization.DocumentAuthorizer getDocumentAuthorizer(AccountingDocument accountingDocument)
accountingDocument
- the given accounting documentprotected String getRiceImagePath()
protected String getKFSImagePath()
protected org.kuali.rice.core.api.config.property.ConfigurationService getConfigurationService()
Copyright © 2004–2015 The Kuali Foundation. All rights reserved.