org.kuali.kfs.sec.document.authorization
Class SecAccountingLineAuthorizer

java.lang.Object
  extended by org.kuali.kfs.sec.document.authorization.SecAccountingLineAuthorizer
All Implemented Interfaces:
AccountingLineAuthorizer

public class SecAccountingLineAuthorizer
extends Object
implements AccountingLineAuthorizer

AccountingLineAuthorizer that wraps access security checks around another AccountingLineAuthorizer configured for the document type


Field Summary
protected  AccountingLineAuthorizer lineAuthorizer
           
 
Constructor Summary
SecAccountingLineAuthorizer()
           
 
Method Summary
 List<AccountingLineViewAction> getActions(AccountingDocument accountingDocument, AccountingLineRenderingContext accountingLineRenderingContext, String accountingLinePropertyName, Integer lineIndex, org.kuali.rice.kim.bo.Person currentUser, String groupTitle)
          Determines what actions are available to act upon the given accounting line
 Set<String> getUnviewableBlocks(AccountingDocument accountingDocument, AccountingLine accountingLine, boolean newLine, org.kuali.rice.kim.bo.Person currentUser)
          Determines which, if any, blocks whose children elements should not in any fashion be rendered
 boolean hasEditPermissionOnAccountingLine(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, org.kuali.rice.kim.bo.Person currentUser, boolean pageIsEditable)
          Makes call to check edit access security on accounting line
 boolean hasEditPermissionOnField(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, String fieldName, boolean editableLine, boolean editablePage, org.kuali.rice.kim.bo.Person currentUser)
          If access was granted to line and line authorizer allows field modify then allow field modify
 boolean isGroupEditable(AccountingDocument accountingDocument, List<? extends AccountingLineRenderingContext> accountingLineRenderingContexts, org.kuali.rice.kim.bo.Person currentUser)
          Determines if any entire group is rendered as editable, which means that a new line will appear
 boolean renderNewLine(AccountingDocument accountingDocument, String accountingGroupProperty)
          Determines if new lines should be rendered for the given accounting line group (identified by its property name)
 void setLineAuthorizer(AccountingLineAuthorizer lineAuthorizer)
          Sets the lineAuthorizer attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineAuthorizer

protected AccountingLineAuthorizer lineAuthorizer
Constructor Detail

SecAccountingLineAuthorizer

public SecAccountingLineAuthorizer()
Method Detail

getActions

public List<AccountingLineViewAction> getActions(AccountingDocument accountingDocument,
                                                 AccountingLineRenderingContext accountingLineRenderingContext,
                                                 String accountingLinePropertyName,
                                                 Integer lineIndex,
                                                 org.kuali.rice.kim.bo.Person currentUser,
                                                 String groupTitle)
Description copied from interface: AccountingLineAuthorizer
Determines what actions are available to act upon the given accounting line

Specified by:
getActions in interface AccountingLineAuthorizer
Parameters:
accountingDocument - the accounting document the line to authorize is owned by
accountingLineRenderingContext - a renderable context wrapping the accounting line that is being authorized against
accountingLinePropertyName - the name of the property that represents the accounting line
lineIndex - 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 line
groupTitle - title of the group from the data dictionary
Returns:
a List of the Actions that are available for this line

getUnviewableBlocks

public Set<String> getUnviewableBlocks(AccountingDocument accountingDocument,
                                       AccountingLine accountingLine,
                                       boolean newLine,
                                       org.kuali.rice.kim.bo.Person currentUser)
Description copied from interface: AccountingLineAuthorizer
Determines which, if any, blocks whose children elements should not in any fashion be rendered

Specified by:
getUnviewableBlocks in interface AccountingLineAuthorizer
Parameters:
accountingDocument - the accounting document the line to authorize is owned by
accountingLine - the accounting line that is being authorized against
newLine - whether the line is a new line or not
Returns:
a Set of the names of blocks that should not being in any way rendered

hasEditPermissionOnAccountingLine

public boolean hasEditPermissionOnAccountingLine(AccountingDocument accountingDocument,
                                                 AccountingLine accountingLine,
                                                 String accountingLineCollectionProperty,
                                                 org.kuali.rice.kim.bo.Person currentUser,
                                                 boolean pageIsEditable)
Makes call to check edit access security on accounting line

Specified by:
hasEditPermissionOnAccountingLine in interface AccountingLineAuthorizer
Parameters:
accountingDocument - the given accounting document
accountingLine - the given accounting line in the document
accountingLineCollectionProperty - the property of the group that holds these accounting lines
currentUser - the current user
pageIsEditable - whether the current page is editable by the current user or not
Returns:
true if the the current user has permission to edit the given accounting line; otherwsie, false
See Also:
AccountingLineAuthorizer.hasEditPermissionOnAccountingLine(org.kuali.kfs.sys.document.AccountingDocument, org.kuali.kfs.sys.businessobject.AccountingLine, java.lang.String, org.kuali.rice.kim.bo.Person, boolean)

hasEditPermissionOnField

public boolean hasEditPermissionOnField(AccountingDocument accountingDocument,
                                        AccountingLine accountingLine,
                                        String accountingLineCollectionProperty,
                                        String fieldName,
                                        boolean editableLine,
                                        boolean editablePage,
                                        org.kuali.rice.kim.bo.Person currentUser)
If access was granted to line and line authorizer allows field modify then allow field modify

Specified by:
hasEditPermissionOnField in interface AccountingLineAuthorizer
Parameters:
accountingDocument - the given accounting document
accountingLine - the given accounting line in the document
accountingLineCollectionProperty - the property of the collection the given accounting line is in
fieldName - the name of a field in the given accounting line
editableLine - whether the parent line of this field is editable
editablePage - whether the parent page of this field is editable
currentUser - the current user
Returns:
true if the the current user has permission to edit the given field in the given accounting line; otherwsie, false
See Also:
AccountingLineAuthorizer.hasEditPermissionOnField(org.kuali.kfs.sys.document.AccountingDocument, org.kuali.kfs.sys.businessobject.AccountingLine, java.lang.String, java.lang.String, boolean, boolean, org.kuali.rice.kim.bo.Person)

isGroupEditable

public boolean isGroupEditable(AccountingDocument accountingDocument,
                               List<? extends AccountingLineRenderingContext> accountingLineRenderingContexts,
                               org.kuali.rice.kim.bo.Person currentUser)
Description copied from interface: AccountingLineAuthorizer
Determines if any entire group is rendered as editable, which means that a new line will appear

Specified by:
isGroupEditable in interface AccountingLineAuthorizer
Parameters:
accountingDocument - the accounting document which the collection of line are on
accountingLineRenderingContexts - the accounting lines of the group, wrapped in AccountingLineRenderingContext implementations
currentUser - the current user
Returns:
true if the group can be edited, false otherwise

renderNewLine

public boolean renderNewLine(AccountingDocument accountingDocument,
                             String accountingGroupProperty)
Description copied from interface: AccountingLineAuthorizer
Determines if new lines should be rendered for the given accounting line group (identified by its property name)

Specified by:
renderNewLine in interface AccountingLineAuthorizer
Parameters:
accountingDocument - the document that has accounting lines being authorized
accountingGroupProperty - the property of this accounting group
Returns:
true if new lines should be displayed, false otherwise

setLineAuthorizer

public void setLineAuthorizer(AccountingLineAuthorizer lineAuthorizer)
Sets the lineAuthorizer attribute value.

Parameters:
lineAuthorizer - The lineAuthorizer to set.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.