[UPDATE]
- adds id generation for ng class of permission git-svn-id: https://svn.libreccm.org/ccm/trunk@4638 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
36e86ffda3
commit
3c71f60e4d
|
|
@ -98,9 +98,12 @@ public abstract class AbstractMarshaller<P extends Portable> {
|
||||||
line = xmlMapper.writeValueAsString(object);
|
line = xmlMapper.writeValueAsString(object);
|
||||||
//log.info(line);
|
//log.info(line);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error(String.format("Unable to write objetct " +
|
log.error(String.format(
|
||||||
"of %s as XML string with name %s.",
|
"Unable to write objetct of %s as XML " +
|
||||||
object.getClass(), file.getName()), e);
|
"string with name %s in file %s.",
|
||||||
|
object.getClass(),
|
||||||
|
object.toString(),
|
||||||
|
file.getName()), e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -113,8 +116,9 @@ public abstract class AbstractMarshaller<P extends Portable> {
|
||||||
fileWriter.write(line);
|
fileWriter.write(line);
|
||||||
fileWriter.write(System.getProperty("line.separator"));
|
fileWriter.write(System.getProperty("line.separator"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error(String.format("Unable to write to file with the" +
|
log.error(String.format(
|
||||||
" name %s.", file.getName()));
|
"Unable to write to file with the name %s.",
|
||||||
|
file.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,22 @@ public class PermissionIdGenerator extends ObjectIdGenerator<String> {
|
||||||
|
|
||||||
final Permission permission = (Permission) forPojo;
|
final Permission permission = (Permission) forPojo;
|
||||||
|
|
||||||
return String.format("{%s}{%s}{%s}",
|
String id = permission.getGrantedPrivilege() +
|
||||||
permission.getGrantedPrivilege(),
|
permission.getPermissionId();
|
||||||
permission.getObject(),
|
boolean a = false, b = false;
|
||||||
permission.getGrantee());
|
if (permission.getObject() != null) {
|
||||||
|
id += permission.getObject().getUuid();
|
||||||
|
a = true;
|
||||||
|
}
|
||||||
|
if (permission.getGrantee() != null) {
|
||||||
|
id += permission.getGrantee().getName();
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!(a || b)) {
|
||||||
|
// throw new IllegalStateException();
|
||||||
|
// }
|
||||||
|
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue