本文整理汇总了Java中org.kuali.rice.kim.api.KimConstants类的典型用法代码示例。如果您正苦于以下问题:Java KimConstants类的具体用法?Java KimConstants怎么用?Java KimConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KimConstants类属于org.kuali.rice.kim.api包,在下文中一共展示了KimConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAuthorization
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
@Override
protected void checkAuthorization(ActionForm form, String methodToCall) throws AuthorizationException {
if (!(form instanceof LookupForm)) {
super.checkAuthorization(form, methodToCall);
} else {
try {
Class businessObjectClass = Class.forName(((LookupForm) form).getBusinessObjectClassName());
if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(
GlobalVariables.getUserSession().getPrincipalId(), KRADConstants.KNS_NAMESPACE,
KimConstants.PermissionTemplateNames.LOOK_UP_RECORDS,
KRADUtils.getNamespaceAndComponentSimpleName(businessObjectClass),
Collections.<String, String>emptyMap())) {
throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(),
KimConstants.PermissionTemplateNames.LOOK_UP_RECORDS,
businessObjectClass.getSimpleName());
}
}
catch (ClassNotFoundException e) {
LOG.warn("Unable to load BusinessObject class: " + ((LookupForm) form).getBusinessObjectClassName(), e);
super.checkAuthorization(form, methodToCall);
}
}
}
示例2: getInquiryUrl
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
@Override
public HtmlData getInquiryUrl(BusinessObject businessObject, String attributeName, boolean forceInquiry) {
/*
* - permission detail values (attribute name and value separated by colon, commas between attributes)
* - required role qualifiers (attribute name and value separated by colon, commas between attributes)
* - list of roles assigned: role type, role namespace, role name
*/
if(NAME.equals(attributeName) || NAME_TO_DISPLAY.equals(attributeName)){
return getInquiryUrlForPrimaryKeys(UberPermissionBo.class, businessObject, Collections.singletonList(KimConstants.PrimaryKeyConstants.PERMISSION_ID), null);
} else if(NAMESPACE_CODE.equals(attributeName) || TEMPLATE_NAMESPACE_CODE.equals(attributeName)){
NamespaceBo parameterNamespace = new NamespaceBo();
String code = (String) KradDataServiceLocator.getDataObjectService().wrap(businessObject).getPropertyValueNullSafe(attributeName);
parameterNamespace.setCode(code);
return getInquiryUrlForPrimaryKeys(NamespaceBo.class, parameterNamespace, Collections.singletonList(KRADPropertyConstants.CODE), null);
} else if(DETAIL_OBJECTS.equals(attributeName)){
//return getAttributesInquiryUrl(businessObject, DETAIL_OBJECTS);
} else if(ASSIGNED_TO_ROLES.equals(attributeName)){
return getAssignedRoleInquiryUrl(businessObject);
}
return super.getInquiryUrl(businessObject, attributeName, forceInquiry);
}
示例3: validAssignGroup
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
protected boolean validAssignGroup(GroupDocumentMember groupMember, IdentityManagementGroupDocument document){
boolean rulePassed = true;
if(StringUtils.isNotEmpty(document.getGroupNamespace())){
Map<String,String> roleDetails = new HashMap<String,String>();
roleDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, document.getGroupNamespace());
roleDetails.put(KimConstants.AttributeConstants.GROUP_NAME, document.getGroupName());
if (!getDocumentDictionaryService().getDocumentAuthorizer(document).isAuthorizedByTemplate(
document,
KimConstants.NAMESPACE_CODE,
KimConstants.PermissionTemplateNames.POPULATE_GROUP,
GlobalVariables.getUserSession().getPerson().getPrincipalId(),
roleDetails, null)){
GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_ASSIGN_GROUP,
new String[] {document.getGroupNamespace(), document.getGroupName()});
rulePassed = false;
}
}
return rulePassed;
}
示例4: getRoleMembersFromDerivedRole
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
@Override
public List<RoleMembership> getRoleMembersFromDerivedRole(String namespaceCode, String roleName, Map<String, String> qualification) {
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode was null or blank");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName was null");
}
List<RoleMembership> members = new ArrayList<RoleMembership>();
if ( qualification != null && !qualification.isEmpty() ) {
String principalId = qualification.get(KimConstants.AttributeConstants.PRINCIPAL_ID);
if (qualification.containsKey(KimConstants.AttributeConstants.PRINCIPAL_ID)
&& hasDerivedRole(principalId, null, namespaceCode,
roleName, qualification)) {
members.add(RoleMembership.Builder.create(null/*roleId*/, null, principalId, MemberType.PRINCIPAL, null).build());
}
}
return members;
}
示例5: canEditGroup
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
/**
* @see ViewAuthorizer#canEditGroup(org.kuali.rice.krad.uif.view.View, org.kuali.rice.krad.uif.view.ViewModel,
* org.kuali.rice.krad.uif.container.Group, java.lang.String, org.kuali.rice.kim.api.identity.Person)
*/
public boolean canEditGroup(View view, ViewModel model, Group group, String groupId, Person user) {
ComponentSecurity componentSecurity = group.getComponentSecurity();
// check component security exists
if (componentSecurity == null) {
return true;
}
// check edit group authz flag is set
if (componentSecurity.isEditAuthz() == null || !componentSecurity.isEditAuthz().booleanValue()) {
return true;
}
return isAuthorizedByTemplate(view, group, model, KimConstants.PermissionTemplateNames.EDIT_GROUP, user, null,
null, false);
}
示例6: canEditWidget
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
/**
* @see ViewAuthorizer#canEditWidget(org.kuali.rice.krad.uif.view.View, org.kuali.rice.krad.uif.view.ViewModel,
* org.kuali.rice.krad.uif.widget.Widget, java.lang.String, org.kuali.rice.kim.api.identity.Person)
*/
public boolean canEditWidget(View view, ViewModel model, Widget widget, String widgetId, Person user) {
ComponentSecurity componentSecurity = widget.getComponentSecurity();
// check component security exists
if (componentSecurity == null) {
return true;
}
// check edit widget authz flag is set
if (componentSecurity.isEditAuthz() == null || !componentSecurity.isEditAuthz().booleanValue()) {
return true;
}
return isAuthorizedByTemplate(view, widget, model, KimConstants.PermissionTemplateNames.EDIT_WIDGET, user, null,
null, false);
}
示例7: canViewWidget
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
/**
* @see ViewAuthorizer#canViewWidget(org.kuali.rice.krad.uif.view.View, org.kuali.rice.krad.uif.view.ViewModel,
* org.kuali.rice.krad.uif.widget.Widget, java.lang.String, org.kuali.rice.kim.api.identity.Person)
*/
public boolean canViewWidget(View view, ViewModel model, Widget widget, String widgetId, Person user) {
ComponentSecurity componentSecurity = widget.getComponentSecurity();
// check component security exists
if (componentSecurity == null) {
return true;
}
// check view widget authz flag is set
if (componentSecurity.isViewAuthz() == null || !componentSecurity.isViewAuthz().booleanValue()) {
return true;
}
return isAuthorizedByTemplate(view, widget, model, KimConstants.PermissionTemplateNames.VIEW_WIDGET, user, null,
null, false);
}
示例8: checkAllowsMaintenanceEdit
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
protected boolean checkAllowsMaintenanceEdit(String initiatorPrincipalId, ParameterBo newBO) {
boolean allowsEdit = false;
ParameterBo parm = newBO;
Map<String, String> permissionDetails = new HashMap<String, String>();
permissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, parm.getNamespaceCode());
permissionDetails.put(KimConstants.AttributeConstants.COMPONENT_NAME, parm.getComponentCode());
permissionDetails.put(KimConstants.AttributeConstants.PARAMETER_NAME, parm.getName());
allowsEdit = KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(
GlobalVariables.getUserSession().getPerson().getPrincipalId(), KRADConstants.KNS_NAMESPACE,
KimConstants.PermissionTemplateNames.MAINTAIN_SYSTEM_PARAMETER, permissionDetails,
Collections.<String, String>emptyMap());
if(!allowsEdit){
putGlobalError(RiceKeyConstants.AUTHORIZATION_ERROR_PARAMETER);
}
return allowsEdit;
}
示例9: removePrincipalFromGroup
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
@Override
public boolean removePrincipalFromGroup(String principalId, String groupId) throws RiceIllegalArgumentException {
incomingParamCheck(principalId, "principalId");
incomingParamCheck(groupId, "groupId");
List<GroupMemberBo> groupMembers =
getActiveGroupMembers(groupId, principalId, KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE);
if(groupMembers.size() == 1) {
GroupMemberBo member = groupMembers.iterator().next();
member.setActiveToDateValue(new java.sql.Timestamp(DateTime.now().getMillis()));
this.dataObjectService.save(member);
KimImplServiceLocator.getGroupInternalService().updateForUserRemovedFromGroup(member.getMemberId(),
member.getGroupId());
return true;
}
return false;
}
示例10: getEditGroupUrl
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
protected HtmlData getEditGroupUrl(GroupBo groupBo) {
String href = "";
Properties parameters = new Properties();
parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
parameters.put(KRADConstants.PARAMETER_COMMAND, KewApiConstants.INITIATE_COMMAND);
parameters.put(KRADConstants.DOCUMENT_TYPE_NAME, KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME);
parameters.put(KimConstants.PrimaryKeyConstants.GROUP_ID, groupBo.getId());
if (StringUtils.isNotBlank(getReturnLocation())) {
parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
}
href = UrlFactory.parameterizeUrl(KimCommonUtilsInternal.getKimBasePath()+KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_ACTION, parameters);
HtmlData.AnchorHtmlData anchorHtmlData = new HtmlData.AnchorHtmlData(href,
KRADConstants.DOC_HANDLER_METHOD, KRADConstants.MAINTENANCE_EDIT_METHOD_TO_CALL);
return anchorHtmlData;
}
示例11: canPartiallyUnmaskField
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
@Override
public boolean canPartiallyUnmaskField(
Person user, Class<?> dataObjectClass, String fieldName, Document document) {
// KFSMI-5095
if(isNonProductionEnvAndUnmaskingTurnedOff()) {
return false;
}
if(user==null || StringUtils.isEmpty(user.getPrincipalId())) {
return false;
}
if ( document == null ) {
return getPermissionService().isAuthorizedByTemplate(user.getPrincipalId(), KRADConstants.KNS_NAMESPACE,
KimConstants.PermissionTemplateNames.PARTIAL_UNMASK_FIELD, new HashMap<String, String>(
getFieldPermissionDetails(dataObjectClass, fieldName)), Collections.<String, String>emptyMap());
} else { // if a document was passed, evaluate the permission in the context of a document
return getDocumentHelperService().getDocumentAuthorizer( document )
.isAuthorizedByTemplate( document,
KRADConstants.KNS_NAMESPACE,
KimConstants.PermissionTemplateNames.PARTIAL_UNMASK_FIELD,
user.getPrincipalId(), getFieldPermissionDetails(dataObjectClass, fieldName), Collections.<String, String>emptyMap() );
}
}
示例12: getGroupQualifier
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
protected Map<String, String> getGroupQualifier( String groupId, String kimTypeId, Map<String, String> groupAttributes, String routeLevel ) {
Map<String, String> qualifier = new HashMap<String, String>();
// pull the group to get its attributes for adding to the qualifier
qualifier.put(KimConstants.PrimaryKeyConstants.KIM_TYPE_ID, kimTypeId);
qualifier.put(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER, kimTypeId);
qualifier.put(KimConstants.PrimaryKeyConstants.GROUP_ID, groupId);
KimTypeService typeService = getTypeService(kimTypeId);
if ( typeService != null ) {
// check for the custom document type for the group
String customDocTypeName = typeService.getWorkflowDocumentTypeName();
if ( StringUtils.isNotBlank(customDocTypeName)) {
qualifier.put(KIM_ATTRIBUTE_DOCUMENT_TYPE_NAME, customDocTypeName );
}
putMatchingAttributesIntoQualifier(qualifier, groupAttributes, typeService.getWorkflowRoutingAttributes(routeLevel) );
}
return qualifier;
}
示例13: validAssignRole
import org.kuali.rice.kim.api.KimConstants; //导入依赖的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;
}
示例14: getKimDelegationMemberImplByDelegationAndId
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
/**
* Retrieves a KimDelegationMemberImpl object by its ID and the ID of the delegation it belongs to. If the
* delegation member exists in the cache,
* this method will return the cached one; otherwise, it will retrieve the uncached version from the database and
* then cache it before returning it.
*/
protected DelegateMemberBo getKimDelegationMemberImplByDelegationAndId(String delegationId,
String delegationMemberId) {
if (StringUtils.isBlank(delegationId) || StringUtils.isBlank(delegationMemberId)) {
return null;
}
Map<String, String> searchCriteria = new HashMap<String, String>(2);
searchCriteria.put(KimConstants.PrimaryKeyConstants.DELEGATION_ID, delegationId);
searchCriteria.put(KimConstants.PrimaryKeyConstants.DELEGATION_MEMBER_ID, delegationMemberId);
QueryResults<DelegateMemberBo> memberList = getDataObjectService().findMatching(DelegateMemberBo.class,
QueryByCriteria.Builder.andAttributes(searchCriteria).build());
if (!memberList.getResults().isEmpty()) {
return memberList.getResults().get(0);
}
return null;
}
示例15: getCreateNewUrl
import org.kuali.rice.kim.api.KimConstants; //导入依赖的package包/类
@Override
public String getCreateNewUrl() {
String url = "";
if (getLookupableHelperService().allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_REVIEW_RESPONSIBILITY_DOCUMENT_TYPE_NAME)) {
Properties parameters = new Properties();
parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, ReviewResponsibilityBo.class.getName());
if (StringUtils.isNotBlank(getReturnLocation())) {
parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
}
url = UrlFactory.parameterizeUrl(KRADConstants.MAINTENANCE_ACTION, parameters);
url = "<a title=\"Create a new record\" href=\"" + url + "\"><img src=\"images/tinybutton-createnew.gif\" alt=\"create new\" width=\"70\" height=\"15\"/></a>";
}
return url;
}