onecx-permissions
Installation
If you want to use this extension, you need to add the org.tkit.onecx.quarkus:onecx-permission extension first to your build file.
For instance, with Maven, add the following dependency to your POM file:
<dependency>
<groupId>org.tkit.onecx.quarkus</groupId>
<artifactId>onecx-permission</artifactId>
<version>2.0.0</version>
</dependency>
Usage
-
First you need to add the maven dependency shown at the top
-
Then you can use @PermissionsAllowed annotation
@GET
@Path("write")
@PermissionsAllowed(value = "onecx:resource#action")
public Response adminWrite() {
return Response.ok("OK").build();
}
Configuration
Configuration property fixed at build time - All other configuration properties are overridable at runtime
Configuration property |
Type |
Default |
|---|---|---|
Tenant client URL configuration. This property is alias for rest-client generated configuration property Environment variable: |
string |
|
Enable interface mapping Environment variable: |
boolean |
|
Enable interface mapping Environment variable: |
boolean |
|
Allow all permissions Environment variable: |
boolean |
|
Product name. Environment variable: |
string |
required |
Permissions application ID. Environment variable: |
string |
|
Permissions prefix name. Environment variable: |
string |
|
Permissions access token header parameter. Environment variable: |
string |
|
Permissions principal token header parameter. Environment variable: |
string |
|
Permissions resource action separator. Environment variable: |
string |
|
Enable or disable mock service Environment variable: |
boolean |
|
Mock data for role Map format : [role].[permission]=[actions] Environment variable: |
Map<String,Map<String,List<String>>> |