public class Privilege extends Object
Privilege
specifies access rules for operations.
A Where clause can used to define instance-based access.
grant: one or more operations (as a string or an array of strings)
to: (optional) one or more user roles the privilege is granted to
where: (optional) a condition that further restricts access
example:
{ grant: ['READ','WRITE'], to: 'admin' }
{ grant: 'READ', where: 'buyer = $user' }Modifier and Type | Class and Description |
---|---|
static class |
Privilege.PredefinedGrant |
static class |
Privilege.PredefinedRole
Predefined roles that are handled specifically
|
Constructor and Description |
---|
Privilege() |
Modifier and Type | Method and Description |
---|---|
Privilege |
addGrant(Privilege.PredefinedGrant grant) |
Privilege |
addGrant(String grant) |
Privilege |
addRole(Privilege.PredefinedRole role) |
Privilege |
addRole(String role) |
String |
getCxnWhereCondition() |
List<String> |
getGrants() |
List<String> |
getRoles() |
String |
getWhereCondition() |
static boolean |
is(String a,
String b) |
void |
setCxnWhereCondition(String cxnWhereCondition) |
void |
setWhereCondition(String whereCondition) |
public Privilege addGrant(Privilege.PredefinedGrant grant)
public Privilege addRole(Privilege.PredefinedRole role)
public String getWhereCondition()
public void setWhereCondition(String whereCondition)
public String getCxnWhereCondition()
public void setCxnWhereCondition(String cxnWhereCondition)
Copyright © 2023. All rights reserved.