java.lang.Object
org.postgresql.pljava.internal.AclId

public final class AclId extends Object
The AclId correspons to the internal PostgreSQL AclId.
Author:
Thomas Hallgren
  • Constructor Summary

    Constructors
    Constructor
    Description
    AclId(int nativeAclId)
    Called from native code.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Returns equal if other is an AclId that is equal to this id.
    static AclId
    Return the id of the named user.
    Return the name that corresponds to this id.
    static AclId
    Return the outer database user id.
    static AclId
    Deprecated.
    As of 1.5.0, this method is retained only for compatibility with old code, and returns the same value as getOuterUser, which should be used instead.
    static AclId
    Return the current effective database user id.
    int
    Returns the hashCode of this id.
    boolean
    Return true if this AclId has the right to create new objects in the given schema.
    int
    Returns the integer value of this id.
    boolean
    Returns true if this AclId represents a super user.
    Returns the result of calling #getName().

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AclId

      public AclId(int nativeAclId)
      Called from native code.
  • Method Details

    • equals

      public boolean equals(Object other)
      Returns equal if other is an AclId that is equal to this id.
      Overrides:
      equals in class Object
    • intValue

      public int intValue()
      Returns the integer value of this id.
    • hashCode

      public int hashCode()
      Returns the hashCode of this id.
      Overrides:
      hashCode in class Object
    • getUser

      public static AclId 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

      public static AclId 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 a SECURITY DEFINER function should revert to if it needs to operate with the invoker's permissions.

      Since:
      1.5.0
    • getSessionUser

      @Deprecated public static AclId getSessionUser()
      Deprecated.
      As of 1.5.0, this method is retained only for compatibility with old code, and returns the same value as getOuterUser, 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 of SET 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 for getOuterUser.
    • fromName

      public static AclId fromName(String name) throws SQLException
      Return the id of the named user.
      Throws:
      SQLException - if the user is unknown to the system.
    • getName

      public String getName()
      Return the name that corresponds to this id.
    • hasSchemaCreatePermission

      public boolean hasSchemaCreatePermission(Oid oid)
      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

      public String toString()
      Returns the result of calling #getName().
      Overrides:
      toString in class Object