Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
App Blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Genesys PGR
App Blocks
Commits
e17d7588
Commit
e17d7588
authored
Mar 31, 2020
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing Javadoc
parent
87ca0951
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
25 deletions
+44
-25
auditlog/src/test/java/org/genesys/blocks/auditlog/test/ApplicationConfig.java
...a/org/genesys/blocks/auditlog/test/ApplicationConfig.java
+0
-4
core/src/main/java/org/genesys/blocks/model/filters/SuperModelFilter.java
...va/org/genesys/blocks/model/filters/SuperModelFilter.java
+2
-1
security/src/main/java/org/genesys/blocks/oauth/service/OAuthClientDetailsService.java
...nesys/blocks/oauth/service/OAuthClientDetailsService.java
+1
-0
security/src/main/java/org/genesys/blocks/security/SecurityContextUtil.java
...java/org/genesys/blocks/security/SecurityContextUtil.java
+12
-5
security/src/main/java/org/genesys/blocks/security/model/BasicUser.java
...ain/java/org/genesys/blocks/security/model/BasicUser.java
+3
-3
security/src/main/java/org/genesys/blocks/security/service/CustomAclService.java
...org/genesys/blocks/security/service/CustomAclService.java
+23
-9
security/src/main/java/org/genesys/blocks/security/service/impl/BasicUserServiceImpl.java
...ys/blocks/security/service/impl/BasicUserServiceImpl.java
+3
-3
No files found.
auditlog/src/test/java/org/genesys/blocks/auditlog/test/ApplicationConfig.java
View file @
e17d7588
...
...
@@ -15,17 +15,13 @@
*/
package
org.genesys.blocks.auditlog.test
;
import
java.util.Arrays
;
import
org.genesys.blocks.security.component.AclAssignerAspect
;
import
org.genesys.blocks.security.service.CustomAclService
;
import
org.genesys.blocks.security.service.impl.CustomAclServiceImpl
;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.concurrent.ConcurrentMapCache
;
import
org.springframework.cache.support.NoOpCacheManager
;
import
org.springframework.cache.support.SimpleCacheManager
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
...
...
core/src/main/java/org/genesys/blocks/model/filters/SuperModelFilter.java
View file @
e17d7588
...
...
@@ -269,7 +269,7 @@ public abstract class SuperModelFilter<T extends SuperModelFilter<T, R>, R> {
*
* @param <Q> any SuperModelFilter subtype
* @param filter the filter
* @return
* @return
the normalized valid filter
*/
public
static
<
Q
extends
SuperModelFilter
<?,
?>>
Q
normalize
(
final
Q
filter
)
{
Set
<
String
>
toClear
=
new
HashSet
<>();
...
...
@@ -317,6 +317,7 @@ public abstract class SuperModelFilter<T extends SuperModelFilter<T, R>, R> {
return
parsed
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
JsonDeserializer
<?>
createContextual
(
DeserializationContext
deserializationContext
,
BeanProperty
beanProperty
)
throws
JsonMappingException
{
final
JavaType
type
;
...
...
security/src/main/java/org/genesys/blocks/oauth/service/OAuthClientDetailsService.java
View file @
e17d7588
...
...
@@ -37,6 +37,7 @@ public interface OAuthClientDetailsService extends ClientDetailsService {
/**
* List client details.
*
* @param pageable the pageable
* @return page with Client details
*/
Page
<
OAuthClient
>
listClientDetails
(
Pageable
pageable
);
...
...
security/src/main/java/org/genesys/blocks/security/SecurityContextUtil.java
View file @
e17d7588
...
...
@@ -59,6 +59,13 @@ public class SecurityContextUtil {
return
(
permissionEvaluator
=
updateBean
(
PermissionEvaluator
.
class
))
!=
null
;
}
/**
* Update bean.
*
* @param <T> the generic type
* @param clazz the clazz
* @return the t
*/
static
final
<
T
>
T
updateBean
(
Class
<
T
>
clazz
)
{
ApplicationContext
context
=
CurrentApplicationContext
.
getContext
();
if
(
context
!=
null
)
{
...
...
@@ -175,11 +182,11 @@ public class SecurityContextUtil {
}
/**
* Check if ROLE_EVERYONE has permission on target object
*
* @param targetDomainObject
* @param permission
* @return
* Check if ROLE_EVERYONE has permission on target object
.
*
* @param targetDomainObject
the target domain object
* @param permission
the permission
* @return
true, if successful
*/
public
static
boolean
anyoneHasPermission
(
Object
targetDomainObject
,
Object
permission
)
{
if
(
permissionEvaluator
==
null
)
{
...
...
security/src/main/java/org/genesys/blocks/security/model/BasicUser.java
View file @
e17d7588
...
...
@@ -455,9 +455,9 @@ public abstract class BasicUser<R extends GrantedAuthority> extends AclSid imple
}
/**
*
Additional authorities
*
* @param authorities
*
Set additional authorities at runtime.
*
* @param authorities
the new runtime authorities
*/
public
void
setRuntimeAuthorities
(
Set
<
String
>
authorities
)
{
this
.
runtimeAuthorities
=
authorities
;
...
...
security/src/main/java/org/genesys/blocks/security/service/CustomAclService.java
View file @
e17d7588
...
...
@@ -70,7 +70,10 @@ public interface CustomAclService extends JsonSidConverter.SidProvider {
AclSid
ensureAuthoritySid
(
String
authority
);
/**
* Removes the sid of the specified authority
* Removes the sid of the specified authority.
*
* @param authorityName the authority name
* @return the acl sid
*/
AclSid
removeAuthoritySid
(
String
authorityName
);
...
...
@@ -82,34 +85,36 @@ public interface CustomAclService extends JsonSidConverter.SidProvider {
List
<
AclSid
>
listAuthoritySids
();
/**
* Adds the creator permissions or updates permission inheritance
* Adds the creator permissions or updates permission inheritance
.
*
* @param entity the target
*/
void
createOrUpdatePermissions
(
AclAwareModel
entity
);
/**
* Updates inheriting status of object identity
* Updates inheriting status of object identity
.
*
* @param objectIdIdentity the id of object identity
* @param entriesInheriting the inheriting status
* @return the acl object identity
*/
AclObjectIdentity
updateInheriting
(
long
objectIdIdentity
,
boolean
entriesInheriting
);
/**
* Updates parent object of object identity
* Updates parent object of object identity
.
*
* @param objectIdIdentity the id of object identity
* @param parentObjectId the id of parent object identity
* @return the acl object identity
*/
AclObjectIdentity
updateParentObject
(
long
objectIdIdentity
,
long
parentObjectId
);
/**
* Set ACL parent object for inherited permissions
*
* Set ACL parent object for inherited permissions
.
*
* @param target the target ACL object on which to change ACL
* @param parent the parent ACL object
* @return
* @return
the acl object identity
*/
AclObjectIdentity
setAclParent
(
AclAwareModel
target
,
AclAwareModel
parent
);
...
...
@@ -198,7 +203,7 @@ public interface CustomAclService extends JsonSidConverter.SidProvider {
AclObjectIdentity
setPermissions
(
AclObjectIdentity
objectIdentity
,
AclSid
sid
,
final
Permissions
permissions
);
/**
* Removes the permissions for SID on ACL OID
* Removes the permissions for SID on ACL OID
.
*
* @param objectIdentity the object identity
* @param aclSid the acl sid
...
...
@@ -283,7 +288,7 @@ public interface CustomAclService extends JsonSidConverter.SidProvider {
String
getSidName
(
long
id
);
/**
* Load object identity extended information
* Load object identity extended information
.
*
* @param objectIdentity the object identity
* @return the acl object identity ext
...
...
@@ -294,11 +299,20 @@ public interface CustomAclService extends JsonSidConverter.SidProvider {
* Wraps {@link AclObjectIdentity} and adds list of inherited permissions.
*/
public
static
class
AclObjectIdentityExt
{
/** The original. */
@JsonUnwrapped
public
AclObjectIdentity
original
;
/** The inherited. */
@JsonSerialize
(
converter
=
AclEntriesToPermissions
.
class
)
public
List
<
AclEntry
>
inherited
=
new
ArrayList
<>();
/**
* Instantiates a new acl object identity ext.
*
* @param source the source
*/
public
AclObjectIdentityExt
(
AclObjectIdentity
source
)
{
this
.
original
=
source
;
}
...
...
security/src/main/java/org/genesys/blocks/security/service/impl/BasicUserServiceImpl.java
View file @
e17d7588
...
...
@@ -161,9 +161,9 @@ public abstract class BasicUserServiceImpl<R extends GrantedAuthority, T extends
}
/**
* Allow the application to register additional authorities
*
* @param user
* Allow the application to register additional authorities
.
*
* @param user
the user
* @return the same object
*/
protected
abstract
Set
<
String
>
getRuntimeAuthorities
(
T
user
);
...
...
Write
Preview
Markdown
is supported
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