java.lang.Object
org.postgresql.pljava.internal.AclId
The
AclId
correspons to the internal PostgreSQL AclId
.- Author:
- Thomas Hallgren
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns equal if other is an AclId that is equal to this id.static AclId
Return the id of the named user.getName()
Return the name that corresponds to this id.static AclId
Return the outer database user id.static AclId
Deprecated.static AclId
getUser()
Return the current effective database user id.int
hashCode()
Returns the hashCode of this id.boolean
Return true if this AclId has the right to create new objects in the given schema.int
intValue()
Returns the integer value of this id.boolean
Returns true if this AclId represents a super user.toString()
Returns the result of calling #getName().
-
Constructor Details
-
AclId
public AclId(int nativeAclId) Called from native code.
-
-
Method Details
-
equals
Returns equal if other is an AclId that is equal to this id. -
intValue
public int intValue()Returns the integer value of this id. -
hashCode
public int hashCode()Returns the hashCode of this id. -
getUser
Return the current effective database user id.Definition: "The one to use for all normal permissions-checking purposes." Within
SECURITY DEFINER
functions and some specialized commands, it can be different from the outer ID. -
getOuterUser
Return the outer database user id.Definition: "the current user ID in effect at the 'outer level' (outside any transaction or function)." The session user id taking into account any
SET ROLE
in effect. This is the ID that aSECURITY DEFINER
function should revert to if it needs to operate with the invoker's permissions.- Since:
- 1.5.0
-
getSessionUser
Deprecated.As of 1.5.0, this method is retained only for compatibility with old code, and returns the same value asgetOuterUser
, which should be used instead. Previously, it returned the session ID unconditionally, which is incorrect for any PostgreSQL version newer than 8.0, because it was unaware ofSET ROLE
introduced in 8.1. Any actual use case for a method that ignores roles and reports only the session ID should be reported as an issue.Deprecated synonym forgetOuterUser
. -
fromName
Return the id of the named user.- Throws:
SQLException
- if the user is unknown to the system.
-
getName
Return the name that corresponds to this id. -
hasSchemaCreatePermission
Return true if this AclId has the right to create new objects in the given schema. -
isSuperuser
public boolean isSuperuser()Returns true if this AclId represents a super user. -
toString
Returns the result of calling #getName().
-
getOuterUser
, which should be used instead.