39 lines
1.0 KiB
Java
39 lines
1.0 KiB
Java
package gr.cite.annotation.web.authorization;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
import org.springframework.boot.context.properties.bind.ConstructorBinding;
|
|
|
|
import java.util.HashMap;
|
|
|
|
@ConfigurationProperties(prefix = "permissions")
|
|
@ConditionalOnProperty(prefix = "permissions", name = "enabled", havingValue = "true")
|
|
public class CustomPermissionAttributesProperties {
|
|
|
|
private final HashMap<String, MyPermission> policies;
|
|
|
|
@ConstructorBinding
|
|
public CustomPermissionAttributesProperties(HashMap<String, MyPermission> policies) {
|
|
this.policies = policies;
|
|
}
|
|
|
|
public HashMap<String, MyPermission> getPolicies() {
|
|
return policies;
|
|
}
|
|
|
|
public static class MyPermission {
|
|
|
|
private final Boolean entityAffiliated;
|
|
|
|
@ConstructorBinding
|
|
public MyPermission(Boolean entityAffiliated) {
|
|
this.entityAffiliated = entityAffiliated;
|
|
}
|
|
|
|
public Boolean getEntityAffiliated() {
|
|
return entityAffiliated;
|
|
}
|
|
}
|
|
|
|
}
|