本文整理汇总了Java中org.kuali.rice.kim.impl.permission.PermissionBo.from方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionBo.from方法的具体用法?Java PermissionBo.from怎么用?Java PermissionBo.from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.impl.permission.PermissionBo
的用法示例。
在下文中一共展示了PermissionBo.from方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* Filters the given permission list to return those that match on widget id, then calls super
* to filter based on view id
*
* @param requestedDetails - map of details requested with permission (used for matching)
* @param permissionsList - list of permissions to process for matches
* @return List<Permission> list of permissions that match the requested details
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
String requestedWidgetId = requestedDetails.get(KimConstants.AttributeConstants.WIDGET_ID);
List<Permission> matchingPermissions = new ArrayList<Permission>();
for (Permission permission : permissionsList) {
PermissionBo bo = PermissionBo.from(permission);
String permissionWidgetId = bo.getDetails().get(KimConstants.AttributeConstants.WIDGET_ID);
if (StringUtils.equals(requestedWidgetId, permissionWidgetId)) {
matchingPermissions.add(permission);
}
}
return super.performPermissionMatches(requestedDetails, matchingPermissions);
}
示例2: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* Filters the given permission list to return those that match on edit mode, then calls super to filter
* based on view id
*
* @param requestedDetails - map of details requested with permission (used for matching)
* @param permissionsList - list of permissions to process for matches
* @return List<Permission> list of permissions that match the requested details
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
for (Permission permission : permissionsList) {
PermissionBo bo = PermissionBo.from(permission);
if (requestedDetails.get(KimConstants.AttributeConstants.EDIT_MODE).equals(bo.getDetails().get(
KimConstants.AttributeConstants.EDIT_MODE))) {
matchingPermissions.add(permission);
}
}
return super.performPermissionMatches(requestedDetails, matchingPermissions);
}
示例3: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails, List<Permission> permissionsList) {
String requestedParameterName = requestedDetails.get(KimConstants.AttributeConstants.PARAMETER_NAME);
String requestedComponentName = requestedDetails.get(KimConstants.AttributeConstants.COMPONENT_NAME);
List<Permission> matchingPermissions = new ArrayList<Permission>();
for (Permission kpi : permissionsList ) {
PermissionBo bo = PermissionBo.from(kpi);
String parameterName = bo.getDetails().get(KimConstants.AttributeConstants.PARAMETER_NAME);
String componentName = bo.getDetails().get(KimConstants.AttributeConstants.COMPONENT_NAME);
if ( (StringUtils.isBlank(parameterName)
|| StringUtils.equals(requestedParameterName, parameterName))
&&(StringUtils.isBlank(componentName)
|| StringUtils.equals(requestedComponentName, componentName))) {
matchingPermissions.add(kpi);
}
}
return super.performPermissionMatches(requestedDetails, matchingPermissions);
}
示例4: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
*
* consider the document type hierarchy - check for a permission that just specifies the document type first at each level
* - then if you don't find that, check for the doc type and the node, then the doc type and the Action Type.
*
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
// loop over the permissions, checking the non-document-related ones
for ( Permission kpi : permissionsList ) {
PermissionBo bo = PermissionBo.from(kpi);
if ( (routeNodeMatches(requestedDetails, bo.getDetails())) &&
(routeStatusMatches(requestedDetails, bo.getDetails())) ) {
matchingPermissions.add( kpi );
}
}
// now, filter the list to just those for the current document
matchingPermissions = super.performPermissionMatches( requestedDetails, matchingPermissions );
return matchingPermissions;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:DocumentTypeAndNodeAndRouteStatusPermissionTypeServiceImpl.java
示例5: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* Permission type service which can check the route node and status as well as the document hierarchy.
*
* Permission should be able to (in addition to taking the routingStatus, routingNote, and documentTypeName attributes)
* should take a documentNumber and retrieve those values from workflow before performing the comparison.
*
* consider the document type hierarchy - check for a permission that just specifies the document type first at each level
* - then if you don't find that, check for the doc type and the node, then the doc type and the state.
*
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
// loop over the permissions, checking the non-document-related ones
for ( Permission kpi : permissionsList ) {
PermissionBo bo = PermissionBo.from(kpi);
if ( routeNodeMatches(requestedDetails, bo.getDetails()) &&
routeStatusMatches(requestedDetails, bo.getDetails()) &&
appDocStatusMatches(requestedDetails, bo.getDetails()) ) {
matchingPermissions.add( kpi );
}
}
// now, filter the list to just those for the current document
matchingPermissions = super.performPermissionMatches( requestedDetails, matchingPermissions );
return matchingPermissions;
}
示例6: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
*
* consider the document type hierarchy - check for a permission that just specifies the document type first at each level
* - then if you don't find that, check for the doc type and the node, then the doc type and the field.
*
* - if the field value passed in starts with the value on the permission detail it is a match. so...
* permision detail sourceAccountingLines will match passed in value of sourceAccountingLines.amount and sourceAccountingLines
* permission detail sourceAccountingLines.objectCode will match sourceAccountingLines.objectCode but not sourceAccountingLines
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
// loop over the permissions, checking the non-document-related ones
for ( Permission kpi : permissionsList ) {
PermissionBo bo = PermissionBo.from(kpi);
if ( routeNodeMatches(requestedDetails, bo.getDetails()) &&
doesPropertyNameMatch(requestedDetails.get(KimConstants.AttributeConstants.PROPERTY_NAME), bo.getDetails().get(KimConstants.AttributeConstants.PROPERTY_NAME)) ) {
matchingPermissions.add( kpi );
}
}
// now, filter the list to just those for the current document
matchingPermissions = super.performPermissionMatches( requestedDetails, matchingPermissions );
return matchingPermissions;
}
示例7: testGetPermission
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
@Test
public void testGetPermission() {
PermissionBo permissionBo = PermissionBo.from(getPermissionService().getPermission("p1"));
assertNotNull(permissionBo);
assertEquals("perm1", permissionBo.getName());
assertEquals("KR-NS", permissionBo.getNamespaceCode());
assertEquals(0, permissionBo.getDetails().size());
assertTrue(permissionBo.isActive());
TemplateBo templateBo = permissionBo.getTemplate();
assertNotNull(templateBo);
assertTrue(templateBo.isActive());
assertEquals("1", templateBo.getKimTypeId());
assertEquals("Default", templateBo.getName());
assertEquals("KUALI", templateBo.getNamespaceCode());
permissionBo = PermissionBo.from(getPermissionService().getPermission("p0"));
assertNull(permissionBo);
}
示例8: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
@Override
protected List<Permission> performPermissionMatches(
Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
if (requestedDetails == null) {
return matchingPermissions; // empty list
}
// loop over the permissions, checking the non-document-related ones
for (Permission kimPermissionInfo : permissionsList) {
PermissionBo bo = PermissionBo.from(kimPermissionInfo);
if (!bo.getDetails().containsKey(
KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE)
|| bo.getDetails().get(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE)
.equals(requestedDetails.get(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE)))
{
matchingPermissions.add(kimPermissionInfo);
}
}
// now, filter the list to just those for the current document
matchingPermissions = super.performPermissionMatches(requestedDetails,
matchingPermissions);
return matchingPermissions;
}
示例9: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* Filters the given permission list to return those that match on field id or property name, then calls super
* to filter based on view id
*
* @param requestedDetails - map of details requested with permission (used for matching)
* @param permissionsList - list of permissions to process for matches
* @return List<Permission> list of permissions that match the requested details
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
String requestedFieldId = null;
if (requestedDetails.containsKey(KimConstants.AttributeConstants.FIELD_ID)) {
requestedFieldId = requestedDetails.get(KimConstants.AttributeConstants.FIELD_ID);
}
String requestedPropertyName = null;
if (requestedDetails.containsKey(KimConstants.AttributeConstants.PROPERTY_NAME)) {
requestedPropertyName = requestedDetails.get(KimConstants.AttributeConstants.PROPERTY_NAME);
}
List<Permission> matchingPermissions = new ArrayList<Permission>();
for (Permission permission : permissionsList) {
PermissionBo bo = PermissionBo.from(permission);
String permissionFieldId = null;
if (bo.getDetails().containsKey(KimConstants.AttributeConstants.FIELD_ID)) {
permissionFieldId = bo.getDetails().get(KimConstants.AttributeConstants.FIELD_ID);
}
String permissionPropertyName = null;
if (bo.getDetails().containsKey(KimConstants.AttributeConstants.PROPERTY_NAME)) {
permissionPropertyName = bo.getDetails().get(KimConstants.AttributeConstants.PROPERTY_NAME);
}
if ((requestedFieldId != null) && (permissionFieldId != null) && StringUtils.equals(requestedFieldId,
permissionFieldId)) {
matchingPermissions.add(permission);
} else if ((requestedPropertyName != null) && (permissionPropertyName != null) && StringUtils.equals(
requestedPropertyName, permissionPropertyName)) {
matchingPermissions.add(permission);
}
}
return super.performPermissionMatches(requestedDetails, matchingPermissions);
}
示例10: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
@Override
protected List<Permission> performPermissionMatches(
Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
if (requestedDetails == null) {
return matchingPermissions; // empty list
}
// loop over the permissions, checking the non-document-related ones
for (Permission kimPermissionInfo : permissionsList) {
PermissionBo bo = PermissionBo.from(kimPermissionInfo);
if (!bo.getDetails().containsKey(
KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE)
|| bo.getDetails().get(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE)
.equals(requestedDetails.get(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE)))
{
matchingPermissions.add(kimPermissionInfo);
}
}
// now, filter the list to just those for the current document
matchingPermissions = super.performPermissionMatches(requestedDetails,
matchingPermissions);
// if we have more than one permission for the document, then we need to check if any have an attachment type code
// if so, we throw away the "less specific" one without an attachment type code
if ( matchingPermissions.size() > 1 ) {
Iterator<Permission> permIter = matchingPermissions.iterator();
while ( permIter.hasNext() ) {
if ( !permIter.next().getAttributes().containsKey(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE) ) {
permIter.remove();
}
}
}
return matchingPermissions;
}
示例11: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
@Override
protected List<Permission> performPermissionMatches(
Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
if (requestedDetails == null) {
return matchingPermissions; // empty list
}
// loop over the permissions, checking the non-document-related ones
for (Permission permission : permissionsList) {
PermissionBo bo = PermissionBo.from(permission);
if (Boolean.parseBoolean(requestedDetails
.get(KimConstants.AttributeConstants.CREATED_BY_SELF))) {
if(Boolean.parseBoolean(bo.getDetails().get(
KimConstants.AttributeConstants.CREATED_BY_SELF_ONLY))){
matchingPermissions.add(permission);
}
}else{
if (!Boolean.parseBoolean(bo.getDetails().get(
KimConstants.AttributeConstants.CREATED_BY_SELF_ONLY))) {
matchingPermissions.add(permission);
}
}
}
matchingPermissions = super.performPermissionMatches(requestedDetails, matchingPermissions);
return matchingPermissions;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:DocumentTypeAndRelationshipToNoteAuthorPermissionTypeService.java
示例12: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* Filters the given permission list to return those that match on field id or action event, then calls super
* to filter based on view id
*
* @param requestedDetails - map of details requested with permission (used for matching)
* @param permissionsList - list of permissions to process for matches
* @return List<Permission> list of permissions that match the requested details
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
String requestedFieldId = null;
if (requestedDetails.containsKey(KimConstants.AttributeConstants.FIELD_ID)) {
requestedFieldId = requestedDetails.get(KimConstants.AttributeConstants.FIELD_ID);
}
String requestedActionEvent = null;
if (requestedDetails.containsKey(KimConstants.AttributeConstants.ACTION_EVENT)) {
requestedActionEvent = requestedDetails.get(KimConstants.AttributeConstants.ACTION_EVENT);
}
List<Permission> matchingPermissions = new ArrayList<Permission>();
for (Permission permission : permissionsList) {
PermissionBo bo = PermissionBo.from(permission);
String permissionFieldId = null;
if (bo.getDetails().containsKey(KimConstants.AttributeConstants.FIELD_ID)) {
permissionFieldId = bo.getDetails().get(KimConstants.AttributeConstants.FIELD_ID);
}
String permissionActionEvent = null;
if (bo.getDetails().containsKey(KimConstants.AttributeConstants.ACTION_EVENT)) {
permissionActionEvent = bo.getDetails().get(KimConstants.AttributeConstants.ACTION_EVENT);
}
if ((requestedFieldId != null) && (permissionFieldId != null) && StringUtils.equals(requestedFieldId,
permissionFieldId)) {
matchingPermissions.add(permission);
} else if ((requestedActionEvent != null) && (permissionActionEvent != null) && StringUtils.equals(
requestedActionEvent, permissionActionEvent)) {
matchingPermissions.add(permission);
}
}
return super.performPermissionMatches(requestedDetails, matchingPermissions);
}
示例13: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
@Override
protected List<Permission> performPermissionMatches(
Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> matchingPermissions = new ArrayList<Permission>();
for (Permission permission : permissionsList) {
PermissionBo bo = PermissionBo.from(permission);
if (requestedDetails.get(KimConstants.AttributeConstants.EDIT_MODE).equals(bo.getDetails().get(KimConstants.AttributeConstants.EDIT_MODE))) {
matchingPermissions.add(permission);
}
}
return super.performPermissionMatches(requestedDetails, matchingPermissions);
}
示例14: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
@Override
public List<Permission> performPermissionMatches(
Map<String, String> requestedDetails,
List<Permission> permissionsList) {
if (permissionsList == null) {
throw new RiceIllegalArgumentException("permissionsList was null or blank");
}
if (requestedDetails == null) {
throw new RiceIllegalArgumentException("requestedDetails was null");
}
List<Permission> matchingPermissions = new ArrayList<Permission>();
// loop over the permissions, checking the non-document-related ones
for (Permission kpi : permissionsList) {
PermissionBo bo = PermissionBo.from(kpi);
if (!bo.getDetails().containsKey(KimConstants.AttributeConstants.ACTION_REQUEST_CD)
|| StringUtils.equals(bo.getDetails().
get(KimConstants.AttributeConstants.ACTION_REQUEST_CD), requestedDetails
.get(KimConstants.AttributeConstants.ACTION_REQUEST_CD))) {
matchingPermissions.add(kpi);
}
}
// now, filter the list to just those for the current document
matchingPermissions = super.performPermissionMatches(requestedDetails,matchingPermissions);
return matchingPermissions;
}
示例15: performPermissionMatches
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* Compare the component and property names between the request and matching permissions.
* Make entries with a matching property name take precedence over those with blank property
* names on the stored permissions. Only match entries with blank property names if
* no entries match on the exact property name.
*/
@Override
protected List<Permission> performPermissionMatches(Map<String, String> requestedDetails,
List<Permission> permissionsList) {
List<Permission> propertyMatches = new ArrayList<Permission>();
List<Permission> prefixPropertyMatches = new ArrayList<Permission>();
List<Permission> blankPropertyMatches = new ArrayList<Permission>();
String propertyName = requestedDetails.get(KimConstants.AttributeConstants.PROPERTY_NAME);
String componentName = requestedDetails.get(KimConstants.AttributeConstants.COMPONENT_NAME);
for ( Permission kpi : permissionsList ) {
PermissionBo bo = PermissionBo.from(kpi);
if ( StringUtils.equals( componentName, bo.getDetails().get( KimConstants.AttributeConstants.COMPONENT_NAME ) ) ) {
String permPropertyName = bo.getDetails().get(KimConstants.AttributeConstants.PROPERTY_NAME);
if ( StringUtils.isBlank( permPropertyName ) ) {
blankPropertyMatches.add( kpi );
} else if ( StringUtils.equals( propertyName, permPropertyName ) ) {
propertyMatches.add( kpi );
} else if ( doesPropertyNameMatch(propertyName, permPropertyName) ) {
prefixPropertyMatches.add( kpi );
}
}
}
if ( !propertyMatches.isEmpty() ) {
return propertyMatches;
} else if ( !prefixPropertyMatches.isEmpty() ) {
return prefixPropertyMatches;
} else {
return blankPropertyMatches;
}
}