Package oracle.security.xs
Class XSAccessController
- java.lang.Object
-
- oracle.security.xs.XSAccessController
-
public class XSAccessController extends java.lang.ObjectThis class provides authorization functions to check the privilege on the ACL based on the session.
-
-
Constructor Summary
Constructors Constructor Description XSAccessController()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckAcl(Session session, byte[] acls, java.lang.String privilege)Checks for a privilege.static booleancheckAcl(Session session, byte[] acls, java.util.List<java.lang.String> privileges)Checks for multiple privileges.static booleancheckAcl(Session session, AclId acls, java.lang.String privilege)Checks for a privilege.static booleancheckAcl(Session session, AclId acls, java.util.List<java.lang.String> privileges)Checks for mutiple privileges.static java.util.Collection<java.lang.String>getPrivileges(Session session, byte[] aclId)Returns a collection of privileges, which is granted in the specified ACL (byte[]), based on the specified session.static java.util.Collection<java.lang.String>getPrivileges(Session session, AclId aclId)Returns a collection of privileges, which is granted in the specified ACL (AclId), based on the specified session.
-
-
-
Method Detail
-
checkAcl
public static boolean checkAcl(Session session, AclId acls, java.util.List<java.lang.String> privileges) throws java.sql.SQLException, XSException, NotAttachedException
Checks for mutiple privileges. The privilege is checked against one or multiple ACLs defined in theAclIdobject. This function returns true only when all the privileges are granted in the specified ACLs. It is important to note that all privileges need not be granted in a single ACL.- Parameters:
session- Sessionacls- ACLsprivileges- a list of privilege names- Returns:
- true if the privilege is grant in all ACLs; otherwise false.
- Throws:
java.sql.SQLException- when a JDBC exception is thrownNotAttachedException- session not attachedXSException- a generic error is detected
-
checkAcl
public static boolean checkAcl(Session session, AclId acls, java.lang.String privilege) throws java.sql.SQLException, XSException, NotAttachedException
Checks for a privilege. The privilege is checked against one or multiple ACLs defined in theAclIdobject- Parameters:
session- Sessionacls- ACLsprivilege- the name of the privilege asString- Returns:
- true if the privilege is granted in one of the gieven ACLs; otherwise false.
- Throws:
java.sql.SQLException- when a JDBC exception is thrownNotAttachedException- session not attachedXSException- a generic error is detected
-
checkAcl
public static boolean checkAcl(Session session, byte[] acls, java.util.List<java.lang.String> privileges) throws java.sql.SQLException, XSException, NotAttachedException
Checks for multiple privileges. The ACL is given in raw (byte[]) format retrived from query, which internally may have one or many ACLs. This function returns true only when all the privileges are granted in the specified ACLs. It is important to note that all privileges need not be granted in a single ACL.- Parameters:
session- Sessionacls- ACLs in raw formatprivileges- list of privilege names- Returns:
- true if all privileges are granted in the ACLs; otherwise false.
- Throws:
java.sql.SQLException- when a JDBC exception is thrownNotAttachedException- the session is not attachedXSException- a generic error is detected
-
checkAcl
public static boolean checkAcl(Session session, byte[] acls, java.lang.String privilege) throws java.sql.SQLException, XSException, NotAttachedException
Checks for a privilege. The privilege is checked against one or multiple ACLs in raw (byte[]) format retrived from query.- Parameters:
session- Sessionacls- ACLs in raw formatprivilege- the name of the privilege asString- Returns:
- true if the privilege is granted in one of the gieven ACLs; otherwise false.
- Throws:
java.sql.SQLException- when a JDBC exception is thrownNotAttachedException- the session is not attachedXSException- a generic error is detected
-
getPrivileges
public static java.util.Collection<java.lang.String> getPrivileges(Session session, AclId aclId) throws java.sql.SQLException, XSException, NotAttachedException
Returns a collection of privileges, which is granted in the specified ACL (AclId), based on the specified session.- Parameters:
session- SessionaclId- AclId- Returns:
- collection of privilege names in String
- Throws:
java.sql.SQLException- when a JDBC exception is thrownNotAttachedException- session not attachedXSException- a generic error is detected
-
getPrivileges
public static java.util.Collection<java.lang.String> getPrivileges(Session session, byte[] aclId) throws java.sql.SQLException, XSException, NotAttachedException
Returns a collection of privileges, which is granted in the specified ACL (byte[]), based on the specified session.- Parameters:
session- SessionaclId- byte[]- Returns:
- collection of privilege names in String
- Throws:
java.sql.SQLException- when a JDBC exception is thrownNotAttachedException- session not attachedXSException- a generic error is detected
-
-