本文整理匯總了Java中org.kuali.rice.kim.impl.permission.GenericPermissionBo.toPermissionBo方法的典型用法代碼示例。如果您正苦於以下問題:Java GenericPermissionBo.toPermissionBo方法的具體用法?Java GenericPermissionBo.toPermissionBo怎麽用?Java GenericPermissionBo.toPermissionBo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.kuali.rice.kim.impl.permission.GenericPermissionBo
的用法示例。
在下文中一共展示了GenericPermissionBo.toPermissionBo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: saveDataObject
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //導入方法依賴的package包/類
/**
* Saves the responsibility via the responsibility update service
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
*/
@Override
public void saveDataObject() {
if (getDataObject() instanceof GenericPermissionBo) {
GenericPermissionBo genericPermissionBo = (GenericPermissionBo)getDataObject();
boolean permissionExists = false;
if (genericPermissionBo.getId() != null) {
permissionExists = KimApiServiceLocator.getPermissionService().getPermission(genericPermissionBo.getId()) != null;
}
if (genericPermissionBo.getTemplateId() != null) {
genericPermissionBo.setTemplate(
PermissionTemplateBo.from(
KimApiServiceLocator.getPermissionService().getPermissionTemplate(genericPermissionBo.getTemplateId())));
}
PermissionBo perm = GenericPermissionBo.toPermissionBo(genericPermissionBo);
if (permissionExists) {
KimApiServiceLocator.getPermissionService().updatePermission(PermissionBo.to(perm));
} else {
KimApiServiceLocator.getPermissionService().createPermission(PermissionBo.to(perm));
}
} else {
throw new RuntimeException(
"Cannot save object of type: " + getDataObjectClass() + " with permission service");
}
}
示例2: saveDataObject
import org.kuali.rice.kim.impl.permission.GenericPermissionBo; //導入方法依賴的package包/類
/**
* Saves the responsibility via the responsibility update service
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
*/
@Override
public void saveDataObject() {
if (getDataObject() instanceof PersistableBusinessObject) {
GenericPermissionBo genericPermissionBo = (GenericPermissionBo)getDataObject();
boolean permissionExists = false;
if (genericPermissionBo.getId() != null) {
permissionExists = KimApiServiceLocator.getPermissionService().getPermission(genericPermissionBo.getId()) != null;
}
if (genericPermissionBo.getTemplateId() != null) {
genericPermissionBo.setTemplate(
PermissionTemplateBo.from(
KimApiServiceLocator.getPermissionService().getPermissionTemplate(genericPermissionBo.getTemplateId())));
}
PermissionBo perm = GenericPermissionBo.toPermissionBo(genericPermissionBo);
if (permissionExists) {
KimApiServiceLocator.getPermissionService().updatePermission(PermissionBo.to(perm));
} else {
KimApiServiceLocator.getPermissionService().createPermission(PermissionBo.to(perm));
}
} else {
throw new RuntimeException(
"Cannot save object of type: " + getDataObjectClass() + " with permission service");
}
}