本文整理汇总了Java中org.kuali.rice.kim.impl.permission.PermissionBo.setTemplate方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionBo.setTemplate方法的具体用法?Java PermissionBo.setTemplate怎么用?Java PermissionBo.setTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.impl.permission.PermissionBo
的用法示例。
在下文中一共展示了PermissionBo.setTemplate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPermission
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* @return a KimPermissionInfo object for the given name, namespace, and varargs "=" delimited attributes
*/
private PermissionBo createPermission(Template permissionTemplate, String name, String namespace, List<String> attrs) {
PermissionBo perm = new PermissionBo();
perm.setName(name);
perm.setNamespaceCode(namespace);
perm.setTemplate(PermissionTemplateBo.from(permissionTemplate));
perm.setTemplateId(permissionTemplate.getId());
Map<String,String> permissionDetails = new HashMap<String,String>();
for (String attr : attrs) {
String [] splitAttr = attr.split("=", 2);
permissionDetails.put(splitAttr[0], splitAttr[1]);
}
List<PermissionAttributeBo> attrBos = KimAttributeDataBo
.createFrom(PermissionAttributeBo.class, permissionDetails,
perm.getTemplate().getKimTypeId());
perm.setAttributeDetails(attrBos);
return perm;
}
示例2: createPermission
import org.kuali.rice.kim.impl.permission.PermissionBo; //导入方法依赖的package包/类
/**
* creates a test permission
*
* @param permissionTemplate - the Template to use to create this permission
* @param name - the permission name
* @param namespace - the namespace code to use
* @param attrs - attributes to set for this permission
*
* @return a KimPermissionInfo object for the given name, namespace, and varargs "=" delimited attributes
*/
private PermissionBo createPermission(Template permissionTemplate, String name, String namespace, String ... attrs) {
PermissionBo perm = new PermissionBo();
perm.setName(name);
perm.setNamespaceCode(namespace);
perm.setTemplate(PermissionTemplateBo.from(permissionTemplate));
perm.setTemplateId(permissionTemplate.getId());
Map<String,String> permissionDetails = new HashMap<String,String>();
for (String attr : attrs) {
String [] splitAttr = attr.split("=", 2);
permissionDetails.put(splitAttr[0], splitAttr[1]);
}
List<PermissionAttributeBo> attrBos = KimAttributeDataBo
.createFrom(PermissionAttributeBo.class, permissionDetails,
perm.getTemplate().getKimTypeId());
perm.setAttributeDetails(attrBos);
return perm;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:NamespaceWildcardAllowedAndOrStringExactMatchPermissionTypeServiceImplTest.java