Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
App Blocks
Commits
8b36e96d
Commit
8b36e96d
authored
Sep 18, 2017
by
Matija Obreza
Browse files
@Transactional does nothing on private methods, TODOs for issue
parent
2906a1d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
security/src/main/java/org/genesys/blocks/security/component/AclAssignerAspect.java
View file @
8b36e96d
...
...
@@ -45,10 +45,12 @@ public class AclAssignerAspect {
needsAcl
=
true
;
}
}
// TODO What about collections of AclAwareModel?
}
try
{
if
(
needsAcl
)
{
// TODO What about collections of AclAwareModel?
final
AclAwareModel
aclModel
=
(
AclAwareModel
)
result
;
LOG
.
debug
(
"Inserting ACL entries for owner={}"
,
aclModel
.
getId
());
aclService
.
addCreatorPermissions
(
aclModel
);
...
...
@@ -74,6 +76,7 @@ public class AclAssignerAspect {
LOG
.
debug
(
"Removing ACL entries for model={}"
,
aclModel
);
aclService
.
removePermissions
(
aclModel
);
}
// TODO What about collections of AclAwareModel?
}
finally
{
// Nothing to do here
}
...
...
security/src/main/java/org/genesys/blocks/security/service/impl/CustomAclServiceImpl.java
View file @
8b36e96d
...
...
@@ -56,7 +56,7 @@ public class CustomAclServiceImpl implements CustomAclService {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
CustomAclServiceImpl
.
class
);
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRE
S_NEW
)
@Transactional
(
propagation
=
Propagation
.
REQUIRE
D
)
public
void
addCreatorPermissions
(
final
AclAwareModel
target
)
{
if
(
target
==
null
)
{
LOG
.
warn
(
"No target specified for ACL permissions, bailing out!"
);
...
...
@@ -96,7 +96,7 @@ public class CustomAclServiceImpl implements CustomAclService {
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRE
S_NEW
)
@Transactional
(
propagation
=
Propagation
.
REQUIRE
D
)
public
void
removePermissions
(
final
AclAwareModel
target
)
{
final
AclObjectIdentity
savedAclObjectIdentity
=
aclObjectIdentityPersistence
.
findByObjectIdIdentityAndClassName
((
Long
)
target
.
getId
(),
target
.
getClass
().
getName
());
if
(
savedAclObjectIdentity
!=
null
)
{
...
...
@@ -108,7 +108,6 @@ public class CustomAclServiceImpl implements CustomAclService {
}
}
@Transactional
private
void
addPermissions
(
final
AclSid
ownerSid
,
final
AclObjectIdentity
objectIdentity
,
final
Map
<
Integer
,
Boolean
>
permissions
)
{
// create Acl Entry
for
(
final
Permission
permission
:
basePermissions
)
{
...
...
@@ -141,7 +140,6 @@ public class CustomAclServiceImpl implements CustomAclService {
return
maxAceOrder
!=
null
?
maxAceOrder
+
1
:
1
;
}
@Transactional
private
AclClass
ensureAclClass
(
final
String
className
)
{
AclClass
aclClass
=
aclClassPersistence
.
findByAclClass
(
className
);
...
...
@@ -155,7 +153,6 @@ public class CustomAclServiceImpl implements CustomAclService {
return
aclClass
;
}
@Transactional
private
AclSid
ensureSid
(
final
String
uuid
,
final
boolean
principal
)
{
AclSid
aclSid
=
aclSidPersistence
.
findBySidAndPrincipal
(
uuid
,
principal
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment