Package org.kuali.rice.kim.document.rule
Class IdentityManagementRoleDocumentRule
java.lang.Object
org.kuali.rice.krad.rules.DocumentRuleBase
org.kuali.rice.kns.rules.DocumentRuleBase
org.kuali.rice.kns.rules.TransactionalDocumentRuleBase
org.kuali.rice.kim.document.rule.IdentityManagementRoleDocumentRule
- All Implemented Interfaces:
AddResponsibilityRule,AddDelegationMemberRule,AddDelegationRule,AddMemberRule,AddPermissionRule,org.kuali.rice.krad.rules.rule.AddAdHocRoutePersonRule,org.kuali.rice.krad.rules.rule.AddAdHocRouteWorkgroupRule,org.kuali.rice.krad.rules.rule.AddCollectionLineRule,org.kuali.rice.krad.rules.rule.AddNoteRule,org.kuali.rice.krad.rules.rule.ApproveDocumentRule,org.kuali.rice.krad.rules.rule.BusinessRule,org.kuali.rice.krad.rules.rule.CompleteDocumentRule,org.kuali.rice.krad.rules.rule.RouteDocumentRule,org.kuali.rice.krad.rules.rule.SaveDocumentRule,org.kuali.rice.krad.rules.rule.SendAdHocRequestsRule
public class IdentityManagementRoleDocumentRule
extends org.kuali.rice.kns.rules.TransactionalDocumentRuleBase
implements AddPermissionRule, AddResponsibilityRule, AddMemberRule, AddDelegationRule, AddDelegationMemberRule
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActiveRoleMemberHelperprotected AddDelegationMemberRuleprotected Class<? extends AddDelegationMemberRule> protected AddDelegationRuleprotected Class<? extends AddDelegationRule> protected AddMemberRuleprotected Class<? extends AddMemberRule> protected AddPermissionRuleprotected Class<? extends AddPermissionRule> protected AddResponsibilityRuleprotected Class<? extends AddResponsibilityRule> protected AttributeValidationHelperstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected booleancheckForCircularRoleMembership(AddMemberEvent addMemberEvent) This method checks to see if adding a role to role membership creates a circular reference.figureOutUniqueQualificationSet(List<KimDocumentRoleMember> memberships, List<org.kuali.rice.kim.api.type.KimAttributeField> attributeDefinitions) Finds the names of the unique qualification attributes which this role should be checking againstfigureOutUniqueQualificationSetForDelegation(List<RoleDocumentDelegationMember> memberships, List<org.kuali.rice.kim.api.type.KimAttributeField> attributeDefinitions) Finds the names of the unique qualification attributes which this role should be checking againstprotected org.kuali.rice.kim.api.identity.IdentityServiceorg.kuali.rice.kim.impl.responsibility.ResponsibilityInternalServiceprotected KimDocumentRoleMembergetRoleMemberForDelegation(List<KimDocumentRoleMember> roleMembers, RoleDocumentDelegationMember delegationMember, List<KimDocumentRoleMember> modifiedRoleMembers) protected org.kuali.rice.kim.framework.role.RoleTypeServicegetRoleTypeService(org.kuali.rice.kim.api.type.KimType typeInfo) protected org.kuali.rice.kim.document.rule.IdentityManagementRoleDocumentRule.VersionedService<org.kuali.rice.kim.framework.role.RoleTypeService> getVersionedRoleTypeService(org.kuali.rice.kim.api.type.KimType typeInfo) booleanhasPermissionToGrantPermission(org.kuali.rice.kim.api.permission.Permission kimPermissionInfo, IdentityManagementRoleDocument document) booleanhasPermissionToGrantResponsibility(org.kuali.rice.kim.api.responsibility.Responsibility kimResponsibilityInfo, IdentityManagementRoleDocument document) booleanprocessAddDelegation(AddDelegationEvent addDelegationEvent) booleanprocessAddDelegationMember(AddDelegationMemberEvent addDelegationMemberEvent) booleanprocessAddMember(AddMemberEvent addMemberEvent) booleanprocessAddPermission(AddPermissionEvent addPermissionEvent) booleanprocessAddResponsibility(AddResponsibilityEvent addResponsibilityEvent) protected booleanprocessCustomSaveDocumentBusinessRules(org.kuali.rice.krad.document.Document document) protected booleansameDelegationMembership(RoleDocumentDelegationMember membershipA, RoleDocumentDelegationMember membershipB) Determines if two memberships represent the same member being added: that is, the two memberships have the same type code and idprotected booleansameMembership(KimDocumentRoleMember membershipA, KimDocumentRoleMember membershipB) Determines if two memberships represent the same member being added: that is, the two memberships have the same type code and idprotected booleansameUniqueDelegationMembershipQualifications(RoleDocumentDelegationMember membershipA, RoleDocumentDelegationMember membershipB, Set<String> uniqueAttributeIds) Given two memberships which represent the same member, do they share qualifications?protected booleansameUniqueMembershipQualifications(KimDocumentRoleMember membershipA, KimDocumentRoleMember membershipB, Set<String> uniqueAttributeIds) Given two memberships which represent the same member, do they share qualifications?protected booleanvalidateActiveDate(String errorPath, Timestamp activeFromDate, Timestamp activeToDate) protected booleanvalidateDelegationMemberRoleQualifier(List<KimDocumentRoleMember> modifiedRoleMembers, List<RoleDocumentDelegationMember> delegationMembers, org.kuali.rice.kim.api.type.KimType kimType, List<KimDocumentRoleMember> nonModifiedRoleMembers) protected booleanvalidateRoleQualifier(List<KimDocumentRoleMember> roleMembers, org.kuali.rice.kim.api.type.KimType kimType) protected booleanvalidateRoleResponsibilityAction(String errorPath, KimDocumentRoleResponsibilityAction roleRspAction) protected booleanvalidateUniquePersonRoleQualifiersUniqueForRoleDelegation(RoleDocumentDelegationMember delegationMembershipToCheck, int membershipToCheckIndex, List<RoleDocumentDelegationMember> delegationMemberships, Set<String> uniqueQualifierIds, List<org.kuali.rice.core.api.uif.RemotableAttributeError> validationErrors) Checks all the qualifiers for the given membership, so that all qualifiers which should be unique are guaranteed to be uniqueprotected booleanvalidateUniquePersonRoleQualifiersUniqueForRoleMembership(KimDocumentRoleMember membershipToCheck, int membershipToCheckIndex, List<KimDocumentRoleMember> memberships, Set<String> uniqueQualifierIds, List<org.kuali.rice.core.api.uif.RemotableAttributeError> validationErrors) Checks all the qualifiers for the given membership, so that all qualifiers which should be unique are guaranteed to be uniqueprotected booleanvalidDelegationMemberActiveDates(List<RoleDocumentDelegationMember> delegationMembers) protected booleanprotected booleanprotected booleanprotected booleanvalidRoleMemberActiveDates(List<KimDocumentRoleMember> roleMembers) protected booleanvalidRoleMemberPrincipalIDs(List<KimDocumentRoleMember> roleMembers) protected booleanvalidRoleMembersResponsibilityActions(List<KimDocumentRoleMember> roleMembers) protected booleanensures therole name is not null or an empty stringinvalid reference
IdentitymangaementRoleDocumentprotected booleanEnsures theIdentityManagementRoleDocumentrole namespace is not null or an empty string.protected booleanvalidRoleResponsibilitiesActions(List<KimDocumentRoleResponsibility> roleResponsibilities) Methods inherited from class org.kuali.rice.kns.rules.DocumentRuleBase
getDictionaryValidationServiceMethods inherited from class org.kuali.rice.krad.rules.DocumentRuleBase
buildDocumentTypeActionRequestPermissionDetails, buildDocumentTypePermissionDetails, getDataDictionaryService, getDocumentDictionaryService, getGroupService, getKualiConfigurationService, getMaxDictionaryValidationDepth, getPermissionService, getPersonService, hasAdHocRouteCompletion, isAddHocRoutePersonValid, isAddHocRouteWorkgroupValid, isAdHocRouteCompletionToInitiator, isAdHocRouteRecipientsValid, isDocumentAttributesValid, isDocumentOverviewValid, isNoteValid, processAddAdHocRoutePerson, processAddAdHocRouteWorkgroup, processAddCollectionLine, processAddNote, processApproveDocument, processCompleteDocument, processCustomAddAdHocRoutePersonBusinessRules, processCustomAddAdHocRouteWorkgroupBusinessRules, processCustomAddCollectionLineBusinessRules, processCustomAddNoteBusinessRules, processCustomApproveDocumentBusinessRules, processCustomCompleteDocumentBusinessRules, processCustomRouteDocumentBusinessRules, processCustomSendAdHocRequests, processRouteDocument, processSaveDocument, processSendAdHocRequests, setDocumentDictionaryService, setMaxDictionaryValidationDepth, useKimPermission, validateSensitiveDataValue
-
Field Details
-
PRIORITY_NUMBER_MIN_VALUE
public static final int PRIORITY_NUMBER_MIN_VALUE- See Also:
-
PRIORITY_NUMBER_MAX_VALUE
public static final int PRIORITY_NUMBER_MAX_VALUE- See Also:
-
addResponsibilityRule
-
addPermissionRule
-
addMemberRule
-
addDelegationRule
-
addDelegationMemberRule
-
addResponsibilityRuleClass
-
addPermissionRuleClass
-
addMemberRuleClass
-
addDelegationRuleClass
-
addDelegationMemberRuleClass
-
attributeValidationHelper
-
activeRoleMemberHelper
-
-
Constructor Details
-
IdentityManagementRoleDocumentRule
public IdentityManagementRoleDocumentRule()
-
-
Method Details
-
getIdentityService
protected org.kuali.rice.kim.api.identity.IdentityService getIdentityService() -
processCustomSaveDocumentBusinessRules
protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.krad.document.Document document) - Overrides:
processCustomSaveDocumentBusinessRulesin classorg.kuali.rice.krad.rules.DocumentRuleBase
-
validRoleNamespace
Ensures theIdentityManagementRoleDocumentrole namespace is not null or an empty string.- Parameters:
roleDoc- theIdentityManagementRoleDocumentto validate.- Returns:
- TRUE if the role namespace is not null or an empty string, FALSE otherwise.
-
validRoleName
ensures therole name is not null or an empty stringinvalid reference
IdentitymangaementRoleDocument- Parameters:
roleDoc- theIdentityManagementRoleDocumentto validate.- Returns:
- TRUE if the role name is not null or an empty string, FALSE otherwise.
-
canUserAssignRoleMembers
-
validRoleMemberPrincipalIDs
-
validDuplicateRoleName
-
validRoleMemberActiveDates
-
validDelegationMemberActiveDates
protected boolean validDelegationMemberActiveDates(List<RoleDocumentDelegationMember> delegationMembers) -
validPermissions
-
validResponsibilities
-
validRoleResponsibilitiesActions
protected boolean validRoleResponsibilitiesActions(List<KimDocumentRoleResponsibility> roleResponsibilities) -
validRoleMembersResponsibilityActions
-
validateRoleResponsibilityAction
protected boolean validateRoleResponsibilityAction(String errorPath, KimDocumentRoleResponsibilityAction roleRspAction) -
validateRoleQualifier
protected boolean validateRoleQualifier(List<KimDocumentRoleMember> roleMembers, org.kuali.rice.kim.api.type.KimType kimType) -
figureOutUniqueQualificationSet
protected Set<String> figureOutUniqueQualificationSet(List<KimDocumentRoleMember> memberships, List<org.kuali.rice.kim.api.type.KimAttributeField> attributeDefinitions) Finds the names of the unique qualification attributes which this role should be checking against- Parameters:
memberships- the memberships (we take the qualification from the first)attributeDefinitions- information about the attributeDefinitions- Returns:
- a Set of unique attribute ids (with their indices, for error reporting)
-
validateUniquePersonRoleQualifiersUniqueForRoleMembership
protected boolean validateUniquePersonRoleQualifiersUniqueForRoleMembership(KimDocumentRoleMember membershipToCheck, int membershipToCheckIndex, List<KimDocumentRoleMember> memberships, Set<String> uniqueQualifierIds, List<org.kuali.rice.core.api.uif.RemotableAttributeError> validationErrors) Checks all the qualifiers for the given membership, so that all qualifiers which should be unique are guaranteed to be unique- Parameters:
membershipToCheck- the membership to checkmembershipToCheckIndex- the index of the person's membership in the role (for error reporting purposes)validationErrors- Mapinvalid input: '<'String, String> of errors to report- Returns:
- true if all unique values are indeed unique, false otherwise
-
sameMembership
protected boolean sameMembership(KimDocumentRoleMember membershipA, KimDocumentRoleMember membershipB) Determines if two memberships represent the same member being added: that is, the two memberships have the same type code and id- Parameters:
membershipA- the first membership to checkmembershipB- the second membership to check- Returns:
- true if the two memberships represent the same member; false if they do not, or if it could not be profitably determined if the members were the same
-
sameUniqueMembershipQualifications
protected boolean sameUniqueMembershipQualifications(KimDocumentRoleMember membershipA, KimDocumentRoleMember membershipB, Set<String> uniqueAttributeIds) Given two memberships which represent the same member, do they share qualifications?- Parameters:
membershipA- the first membership to checkmembershipB- the second membership to checkuniqueAttributeIds- the Set of attribute definition ids which should be unique- Returns:
-
getRoleMemberForDelegation
protected KimDocumentRoleMember getRoleMemberForDelegation(List<KimDocumentRoleMember> roleMembers, RoleDocumentDelegationMember delegationMember, List<KimDocumentRoleMember> modifiedRoleMembers) -
validateDelegationMemberRoleQualifier
protected boolean validateDelegationMemberRoleQualifier(List<KimDocumentRoleMember> modifiedRoleMembers, List<RoleDocumentDelegationMember> delegationMembers, org.kuali.rice.kim.api.type.KimType kimType, List<KimDocumentRoleMember> nonModifiedRoleMembers) -
figureOutUniqueQualificationSetForDelegation
protected Set<String> figureOutUniqueQualificationSetForDelegation(List<RoleDocumentDelegationMember> memberships, List<org.kuali.rice.kim.api.type.KimAttributeField> attributeDefinitions) Finds the names of the unique qualification attributes which this role should be checking against- Parameters:
memberships- the memberships (we take the qualification from the first)attributeDefinitions- information about the attributeDefinitions- Returns:
- a Set of unique attribute ids (with their indices, for error reporting)
-
validateUniquePersonRoleQualifiersUniqueForRoleDelegation
protected boolean validateUniquePersonRoleQualifiersUniqueForRoleDelegation(RoleDocumentDelegationMember delegationMembershipToCheck, int membershipToCheckIndex, List<RoleDocumentDelegationMember> delegationMemberships, Set<String> uniqueQualifierIds, List<org.kuali.rice.core.api.uif.RemotableAttributeError> validationErrors) Checks all the qualifiers for the given membership, so that all qualifiers which should be unique are guaranteed to be unique- Parameters:
delegationMembershipToCheck- the membership to checkmembershipToCheckIndex- the index of the person's membership in the role (for error reporting purposes)validationErrors- Mapinvalid input: '<'String, String> of errors to report- Returns:
- true if all unique values are indeed unique, false otherwise
-
sameDelegationMembership
protected boolean sameDelegationMembership(RoleDocumentDelegationMember membershipA, RoleDocumentDelegationMember membershipB) Determines if two memberships represent the same member being added: that is, the two memberships have the same type code and id- Parameters:
membershipA- the first membership to checkmembershipB- the second membership to check- Returns:
- true if the two memberships represent the same member; false if they do not, or if it could not be profitably determined if the members were the same
-
sameUniqueDelegationMembershipQualifications
protected boolean sameUniqueDelegationMembershipQualifications(RoleDocumentDelegationMember membershipA, RoleDocumentDelegationMember membershipB, Set<String> uniqueAttributeIds) Given two memberships which represent the same member, do they share qualifications?- Parameters:
membershipA- the first membership to checkmembershipB- the second membership to checkuniqueAttributeIds- the Set of attribute definition ids which should be unique- Returns:
-
validateActiveDate
-
checkForCircularRoleMembership
This method checks to see if adding a role to role membership creates a circular reference.- Parameters:
addMemberEvent-- Returns:
- true - ok to assign, no circular references false - do not make assignment, will create circular reference.
-
getAddResponsibilityRule
- Returns:
- the addResponsibilityRule
-
getAddPermissionRule
- Returns:
- the addPermissionRule
-
getAddMemberRule
- Returns:
- the addMemberRule
-
getAddDelegationRule
- Returns:
- the addDelegationRule
-
getAddDelegationMemberRule
- Returns:
- the addDelegationMemberRule
-
processAddPermission
- Specified by:
processAddPermissionin interfaceAddPermissionRule
-
hasPermissionToGrantPermission
public boolean hasPermissionToGrantPermission(org.kuali.rice.kim.api.permission.Permission kimPermissionInfo, IdentityManagementRoleDocument document) - Specified by:
hasPermissionToGrantPermissionin interfaceAddPermissionRule
-
processAddResponsibility
- Specified by:
processAddResponsibilityin interfaceAddResponsibilityRule
-
hasPermissionToGrantResponsibility
public boolean hasPermissionToGrantResponsibility(org.kuali.rice.kim.api.responsibility.Responsibility kimResponsibilityInfo, IdentityManagementRoleDocument document) - Specified by:
hasPermissionToGrantResponsibilityin interfaceAddResponsibilityRule
-
processAddMember
- Specified by:
processAddMemberin interfaceAddMemberRule
-
processAddDelegation
- Specified by:
processAddDelegationin interfaceAddDelegationRule
-
processAddDelegationMember
- Specified by:
processAddDelegationMemberin interfaceAddDelegationMemberRule
-
getResponsibilityInternalService
public org.kuali.rice.kim.impl.responsibility.ResponsibilityInternalService getResponsibilityInternalService() -
getRoleTypeService
protected org.kuali.rice.kim.framework.role.RoleTypeService getRoleTypeService(org.kuali.rice.kim.api.type.KimType typeInfo) -
getVersionedRoleTypeService
protected org.kuali.rice.kim.document.rule.IdentityManagementRoleDocumentRule.VersionedService<org.kuali.rice.kim.framework.role.RoleTypeService> getVersionedRoleTypeService(org.kuali.rice.kim.api.type.KimType typeInfo)
-