* @return
*/
public static void editRole(String name, String inheritedRole,
String description, String newName) throws RoleNotFoundException, RoleNotModifiableException {
if (!RoleDao.exists(name)) throw new RoleNotFoundException(name + " role does not exist!");
ORole role = RoleDao.getRole(name);
ODocument roleDoc=role.getDocument();
if (roleDoc.field(FIELD_MODIFIABLE)==Boolean.FALSE) throw new RoleNotModifiableException(name + " role is not modifiable");
if (!StringUtils.isEmpty(inheritedRole)) {
if (!RoleDao.exists(inheritedRole)) {
RoleNotFoundException e = new RoleNotFoundException(inheritedRole + " role does not exist!");
e.setInehrited(true);
throw e;
}
ORole roleIn=RoleDao.getRole(inheritedRole);
roleDoc.field(RoleDao.FIELD_INHERITED,roleIn.getDocument().getRecord());
}