本文整理汇总了Java中org.kuali.rice.kim.document.IdentityManagementRoleDocument类的典型用法代码示例。如果您正苦于以下问题:Java IdentityManagementRoleDocument类的具体用法?Java IdentityManagementRoleDocument怎么用?Java IdentityManagementRoleDocument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IdentityManagementRoleDocument类属于org.kuali.rice.kim.document包,在下文中一共展示了IdentityManagementRoleDocument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validAssignRole
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
protected boolean validAssignRole(IdentityManagementRoleDocument document) {
boolean rulePassed = true;
if (StringUtils.isNotEmpty(document.getRoleNamespace())) {
Map<String, String> additionalPermissionDetails = new HashMap<String, String>();
additionalPermissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, document.getRoleNamespace());
additionalPermissionDetails.put(KimConstants.AttributeConstants.ROLE_NAME, document.getRoleName());
if (!getDocumentHelperService().getDocumentAuthorizer(document).isAuthorizedByTemplate(
document,
KimConstants.NAMESPACE_CODE,
KimConstants.PermissionTemplateNames.ASSIGN_ROLE,
GlobalVariables.getUserSession().getPrincipalId(),
additionalPermissionDetails, null)) {
rulePassed = false;
}
}
return rulePassed;
}
示例2: setDelegationMembersInDocument
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
@Override
public void setDelegationMembersInDocument(IdentityManagementRoleDocument identityManagementRoleDocument){
if(CollectionUtils.isNotEmpty(identityManagementRoleDocument.getDelegations())){
for(RoleDocumentDelegation delegation: identityManagementRoleDocument.getDelegations()){
if(CollectionUtils.isNotEmpty(delegation.getMembers())){
RoleMemberBo roleMember;
for(RoleDocumentDelegationMember member: delegation.getMembers()){
member.setDelegationTypeCode(delegation.getDelegationTypeCode());
if (StringUtils.isEmpty(member.getRoleMemberName())) {
roleMember = getRoleMemberForRoleMemberId(member.getRoleMemberId());
if(roleMember!=null){
member.setRoleMemberName(getMemberName(roleMember.getType(), roleMember.getMemberId()));
member.setRoleMemberNamespaceCode(getMemberNamespaceCode(roleMember.getType(), roleMember.getMemberId()));
}
}
member.setEdit(true);
identityManagementRoleDocument.getDelegationMembers().add(member);
}
}
}
}
}
示例3: setMembersInDocument
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
@Override
public void setMembersInDocument(IdentityManagementRoleDocument identityManagementRoleDocument){
RoleBo roleBo = getDataObjectService().find(RoleBo.class, identityManagementRoleDocument.getRoleId());
List<RoleMemberBo> members = roleBo.getMembers();
List<RoleMemberBo> membersToRemove = new ArrayList<RoleMemberBo>();
boolean found = false;
for(KimDocumentRoleMember modifiedMember : identityManagementRoleDocument.getModifiedMembers() ) {
for(RoleMemberBo member : members) {
if (modifiedMember.getRoleMemberId().equals(member.getId())) {
membersToRemove.add(member);
found = true;
}
if (found) {
break;
}
}
}
for(RoleMemberBo memberToRemove : membersToRemove ) {
members.remove(memberToRemove);
}
identityManagementRoleDocument.setMembers(loadRoleMembers(identityManagementRoleDocument, members));
loadMemberRoleRspActions(identityManagementRoleDocument);
}
示例4: getChangedRoleResponsibilityIds
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
protected Set<String> getChangedRoleResponsibilityIds(
IdentityManagementRoleDocument identityManagementRoleDocument, List<RoleResponsibilityBo> origRoleResponsibilities){
Set<String> lRet = new HashSet<String>();
List<String> newResp = new ArrayList<String>();
List<String> oldResp = new ArrayList<String>();
if(CollectionUtils.isNotEmpty(identityManagementRoleDocument.getResponsibilities())){
for(KimDocumentRoleResponsibility documentRoleResponsibility: identityManagementRoleDocument.getResponsibilities()){
newResp.add(documentRoleResponsibility.getResponsibilityId());
}
}
if(ObjectUtils.isNotNull(origRoleResponsibilities)){
for(RoleResponsibilityBo roleRespBo: origRoleResponsibilities){
oldResp.add(roleRespBo.getResponsibilityId());
}
}
lRet.addAll(newResp);
lRet.addAll(oldResp);
return lRet;
}
示例5: validAssignRole
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
protected boolean validAssignRole(KimDocumentRoleMember roleMember, IdentityManagementRoleDocument document){
boolean rulePassed = true;
if(StringUtils.isNotEmpty(document.getRoleNamespace())){
Map<String,String> roleDetails = new HashMap<String,String>();
roleDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, document.getRoleNamespace());
roleDetails.put(KimConstants.AttributeConstants.ROLE_NAME, document.getRoleName());
if (!getDocumentDictionaryService().getDocumentAuthorizer(document).isAuthorizedByTemplate(
document,
KimConstants.NAMESPACE_CODE,
KimConstants.PermissionTemplateNames.ASSIGN_ROLE,
GlobalVariables.getUserSession().getPerson().getPrincipalId(),
roleDetails, null)){
GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_ASSIGN_ROLE,
new String[] {document.getRoleNamespace(), document.getRoleName()});
rulePassed = false;
}
}
return rulePassed;
}
示例6: resolve
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
/**
* This overridden method ...
*
* @see org.kuali.rice.kew.role.QualifierResolver#resolve(org.kuali.rice.kew.engine.RouteContext)
*/
public List<Map<String, String>> resolve(RouteContext context) {
String routeLevel = context.getNodeInstance().getName();
Document document = getDocument(context);
List<Map<String, String>> qualifiers = new ArrayList<Map<String, String>>();
String customDocTypeName = null;
if ( document instanceof IdentityManagementGroupDocument ) {
customDocTypeName = handleGroupDocument(qualifiers, (IdentityManagementGroupDocument)document, routeLevel);
} else if ( document instanceof IdentityManagementRoleDocument ) {
customDocTypeName = handleRoleDocument(qualifiers, (IdentityManagementRoleDocument)document, routeLevel);
} else if ( document instanceof IdentityManagementPersonDocument ) {
customDocTypeName = handlePersonDocument(qualifiers, (IdentityManagementPersonDocument)document, routeLevel);
}
// add standard components
decorateWithCommonQualifiers(qualifiers, context, customDocTypeName);
// return the resulting list of Map<String, String>s
return qualifiers;
}
示例7: validDuplicateRoleName
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected boolean validDuplicateRoleName(IdentityManagementRoleDocument roleDoc){
Role role = KimApiServiceLocator.getRoleService().getRoleByNamespaceCodeAndName(roleDoc.getRoleNamespace(),
roleDoc.getRoleName());
boolean rulePassed = true;
if(role!=null){
if(role.getId().equals(roleDoc.getRoleId())) {
rulePassed = true;
}
else{
GlobalVariables.getMessageMap().putError("document.roleName",
RiceKeyConstants.ERROR_DUPLICATE_ENTRY, new String[] {"Role Name"});
rulePassed = false;
}
}
return rulePassed;
}
示例8: setDelegationMembersInDocument
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
public void setDelegationMembersInDocument(IdentityManagementRoleDocument identityManagementRoleDocument){
if(CollectionUtils.isNotEmpty(identityManagementRoleDocument.getDelegations())){
for(RoleDocumentDelegation delegation: identityManagementRoleDocument.getDelegations()){
if(CollectionUtils.isNotEmpty(delegation.getMembers())){
RoleMemberBo roleMember;
for(RoleDocumentDelegationMember member: delegation.getMembers()){
member.setDelegationTypeCode(delegation.getDelegationTypeCode());
if (StringUtils.isEmpty(member.getRoleMemberName())) {
roleMember = getRoleMemberForRoleMemberId(member.getRoleMemberId());
if(roleMember!=null){
member.setRoleMemberName(getMemberName(roleMember.getType(), roleMember.getMemberId()));
member.setRoleMemberNamespaceCode(getMemberNamespaceCode(roleMember.getType(), roleMember.getMemberId()));
}
}
member.setEdit(true);
identityManagementRoleDocument.getDelegationMembers().add(member);
}
}
}
}
}
示例9: setMembersInDocument
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
public void setMembersInDocument(IdentityManagementRoleDocument identityManagementRoleDocument){
if(CollectionUtils.isNotEmpty(identityManagementRoleDocument.getDelegations())){
Map<String, String> criteria = new HashMap<String, String>();
criteria.put(KimConstants.PrimaryKeyConstants.ROLE_ID, identityManagementRoleDocument.getRoleId());
RoleBo roleBo = getBusinessObjectService().findByPrimaryKey(RoleBo.class, criteria);
List<RoleMemberBo> members = roleBo.getMembers();
List<RoleMemberBo> membersToRemove = new ArrayList<RoleMemberBo>();
boolean found = false;
for(KimDocumentRoleMember modifiedMember : identityManagementRoleDocument.getModifiedMembers() ) {
for(RoleMemberBo member : members) {
if (modifiedMember.getRoleMemberId().equals(member.getId())) {
membersToRemove.add(member);
found = true;
}
if (found) break;
}
}
for(RoleMemberBo memberToRemove : membersToRemove ) {
members.remove(memberToRemove);
}
identityManagementRoleDocument.setMembers(loadRoleMembers(identityManagementRoleDocument, members));
loadMemberRoleRspActions(identityManagementRoleDocument);
}
}
示例10: setDocument
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
@Override
public void setDocument(Document document) {
if (document != null) {
// Restore transient KimType on the document as it gets nuked during save, submit (etc?)
IdentityManagementRoleDocument roleDocument = (IdentityManagementRoleDocument) document;
roleDocument.setKimType(getKimType());
}
super.setDocument(document);
}
示例11: canAssignToRole
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
protected boolean canAssignToRole(IdentityManagementRoleDocument document, String initiatorPrincipalId){
boolean rulePassed = true;
Map<String,String> additionalPermissionDetails = new HashMap<String,String>();
additionalPermissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, document.getRoleNamespace());
additionalPermissionDetails.put(KimConstants.AttributeConstants.ROLE_NAME, document.getRoleName());
if(!getDocumentHelperService().getDocumentAuthorizer(document).isAuthorizedByTemplate(
document, KimConstants.NAMESPACE_CODE, KimConstants.PermissionTemplateNames.ASSIGN_ROLE,
initiatorPrincipalId, additionalPermissionDetails, null)){
rulePassed = false;
}
return rulePassed;
}
示例12: loadRoleDoc
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
@Override
public void loadRoleDoc(IdentityManagementRoleDocument identityManagementRoleDocument, Role role){
RoleBo roleBo = getDataObjectService().find(RoleBo.class, role.getId());
identityManagementRoleDocument.setRoleId(roleBo.getId());
identityManagementRoleDocument.setKimType(KimTypeBo.to(roleBo.getKimRoleType()));
identityManagementRoleDocument.setRoleTypeName(roleBo.getKimRoleType().getName());
identityManagementRoleDocument.setRoleTypeId(roleBo.getKimTypeId());
identityManagementRoleDocument.setRoleName(roleBo.getName());
identityManagementRoleDocument.setRoleDescription(roleBo.getDescription());
identityManagementRoleDocument.setActive(roleBo.isActive());
identityManagementRoleDocument.setRoleNamespace(roleBo.getNamespaceCode());
identityManagementRoleDocument.setEditing(true);
identityManagementRoleDocument.setPermissions(loadPermissions(
getDataObjectService().findMatching(RolePermissionBo.class,
QueryByCriteria.Builder.forAttribute(KimConstants.PrimaryKeyConstants.SUB_ROLE_ID, role.getId()).build()).getResults()));
identityManagementRoleDocument.setResponsibilities(loadResponsibilities(
getDataObjectService().findMatching(RoleResponsibilityBo.class,
QueryByCriteria.Builder.forAttribute(KimConstants.PrimaryKeyConstants.SUB_ROLE_ID, role.getId()).build()).getResults()));
loadResponsibilityRoleRspActions(identityManagementRoleDocument);
identityManagementRoleDocument.setMembers(loadRoleMembers(identityManagementRoleDocument, roleBo.getMembers()));
loadMemberRoleRspActions(identityManagementRoleDocument);
identityManagementRoleDocument.setDelegations(loadRoleDocumentDelegations(identityManagementRoleDocument, getRoleDelegations(roleBo.getId())));
//Since delegation members are flattened out on the UI...
setDelegationMembersInDocument(identityManagementRoleDocument);
identityManagementRoleDocument.setKimType(KimTypeBo.to(roleBo.getKimRoleType()));
}
示例13: loadRoleMembersBasedOnSearch
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
@Override
public void loadRoleMembersBasedOnSearch(IdentityManagementRoleDocument identityManagementRoleDocument,
String memberSearchValue){
List<KimDocumentRoleMember> roleMembersRestricted = new ArrayList<KimDocumentRoleMember>();
List<KimDocumentRoleMember> members = identityManagementRoleDocument.getMembers();
for (KimDocumentRoleMember roleMember : members){
String memberName = roleMember.getMemberName().toLowerCase();
if (memberName.startsWith(memberSearchValue.toLowerCase())) {
roleMembersRestricted.add(roleMember);
}
}
identityManagementRoleDocument.setSearchResultMembers(roleMembersRestricted);
}
示例14: clearRestrictedRoleMembersSearchResults
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
@Override
public void clearRestrictedRoleMembersSearchResults(IdentityManagementRoleDocument identityManagementRoleDocument) {
List<KimDocumentRoleMember> roleMembersRestricted = new ArrayList<KimDocumentRoleMember>();
List<KimDocumentRoleMember> members = identityManagementRoleDocument.getMembers();
identityManagementRoleDocument.setSearchResultMembers(roleMembersRestricted);
identityManagementRoleDocument.setMembers(members);
}
示例15: loadResponsibilityRoleRspActions
import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入依赖的package包/类
protected void loadResponsibilityRoleRspActions(IdentityManagementRoleDocument identityManagementRoleDocument){
if(CollectionUtils.isNotEmpty(identityManagementRoleDocument.getResponsibilities())){
for(KimDocumentRoleResponsibility responsibility: identityManagementRoleDocument.getResponsibilities()){
responsibility.getRoleRspActions().addAll(loadKimDocumentRoleRespActions(
getRoleResponsibilityActionImpls(responsibility.getRoleResponsibilityId())));
}
}
}