Package com.sap.cds.services.utils.model
Class Privilege
java.lang.Object
com.sap.cds.services.utils.model.Privilege
A
Privilege specifies access rules for operations. A Where clause can be 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' }
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumPredefined roles that are handled specifically -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()getRoles()com.sap.cds.ql.cqn.CqnPredicatebooleanhasWhere()booleanhasWhereUsing(String xpr) static booleanvoidsetCxnWhereCondition(String cxnWhereCondition) voidsetWhereCQL(String whereCQL) voidsetWhereXpr(com.sap.cds.ql.cqn.CqnPredicate where)
-
Constructor Details
-
Privilege
public Privilege() -
Privilege
-
-
Method Details
-
copy
-
getGrants
-
addGrant
-
addGrant
-
getRoles
-
addRole
-
addRole
-
getWhereCQL
-
setWhereCQL
-
getWhereXpr
public com.sap.cds.ql.cqn.CqnPredicate getWhereXpr() -
setWhereXpr
public void setWhereXpr(com.sap.cds.ql.cqn.CqnPredicate where) -
hasWhere
public boolean hasWhere() -
getCxnWhereCondition
-
setCxnWhereCondition
-
hasWhereUsing
-
is
-