Added missing commit which causes missing users creation

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@133675 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-10-27 16:42:04 +00:00
parent 3db2e67582
commit 36d21a8542
1 changed files with 5 additions and 6 deletions

View File

@ -93,8 +93,9 @@ public class SecurityContext {
public static void createSecurityContext(OrientGraph orientGraph,
UUID context, boolean commit) {
OSecurity oSecurity = orientGraph.getRawGraph().getMetadata()
.getSecurity();
ODatabaseDocumentTx oDatabaseDocumentTx = orientGraph.getRawGraph();
OSecurity oSecurity = oDatabaseDocumentTx.getMetadata().getSecurity();
ORole writer = oSecurity.getRole(DEFAULT_WRITER_ROLE);
ORole reader = oSecurity.getRole(DEFAULT_READER_ROLE);
@ -124,9 +125,7 @@ public class SecurityContext {
.get(SecurityContextMapper.PermissionMode.READER),
readerRole);
if (commit) {
orientGraph.commit();
}
oDatabaseDocumentTx.commit();
logger.trace(
"Security Context (roles and users) with UUID {} successfully created",