com.ibm.security.auth

Class SAFPermission

  • java.lang.Object
    • java.security.Permission
      • com.ibm.security.auth.SAFPermission
  • All Implemented Interfaces:
    java.io.Serializable, java.security.Guard


    public final class SAFPermission
    extends java.security.Permission
    implements java.io.Serializable
    The SAFPermission class extends the Permission class. These permissions will be used for a permission check in RACF.

    The SAF Permission take three instance variables: securityClass : The name of the RACF class of resources (1-8 characters) and is ??optional?? entityName : Specifies the name of the resource (1-246 characters) and is required. access : Specifies a numeric value that identifies the type of access to check for and is optional. The name string (inherited from Permission is the entityName. The securityClass string will be added as a private String. The access integer will be added as private Integer.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      SAFPermission(java.lang.String entityName)
      Creates a new SAFPermission with the specified entity _name and default values for securityClass and access.
      SAFPermission(java.lang.String entityName, java.lang.Integer access)
      Creates a new SAFPermission with the specified entityName and access with a default security class of ????
      SAFPermission(java.lang.String securityClass, java.lang.String entityName)
      Creates a new SAFPermission with the specified securityClass, and entityName with a defaulted access of READ.
      SAFPermission(java.lang.String securityClass, java.lang.String entityName, java.lang.Integer access)
      Creates a new SAFPermission with the specified securityClass, entityName and access.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj)
      Checks two SAFPermission objects for equality.
      java.lang.Integer getAccess()
      Returns the Access for this object.
      java.lang.String getActions()
      Returns the Actions value for this object.
      java.lang.String getSecurityClass()
      Returns the Security Class for this object from this class.
      int hashCode()
      Returns the hash code value for this object.
      boolean implies(java.security.Permission p)
      Calls RACF to verify the permission.
      java.security.PermissionCollection newPermissionCollection()
      Returns a new PermissionCollection object for storing SAFPermission objects.
      java.lang.String toString()
      Returns the a String that is a concatenation of the securityClass, the name and the access.
      • Methods inherited from class java.security.Permission

        checkGuard, getName
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • __READ_RESOURCE

        public static final java.lang.Integer __READ_RESOURCE
      • __UPDATE_RESOURCE

        public static final java.lang.Integer __UPDATE_RESOURCE
      • __CONTROL_RESOURCE

        public static final java.lang.Integer __CONTROL_RESOURCE
      • __ALTER_RESOURCE

        public static final java.lang.Integer __ALTER_RESOURCE
    • Constructor Detail

      • SAFPermission

        public SAFPermission(java.lang.String securityClass,
                             java.lang.String entityName,
                             java.lang.Integer access)
        Creates a new SAFPermission with the specified securityClass, entityName and access.
        Parameters:
        entityName - the entityName of the SAFPermission.
        securityClass - the securityClass of the SAFPermission.
        access - the access of the SAFPermission.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if name is empty.
      • SAFPermission

        public SAFPermission(java.lang.String securityClass,
                             java.lang.String entityName)
        Creates a new SAFPermission with the specified securityClass, and entityName with a defaulted access of READ.
        Parameters:
        entityName - the entityName of the SAFPermission.
        securityClass - the securityClass of the SAFPermission.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if name is empty.
      • SAFPermission

        public SAFPermission(java.lang.String entityName,
                             java.lang.Integer access)
        Creates a new SAFPermission with the specified entityName and access with a default security class of ????
        Parameters:
        entityName - the entityName of the SAFPermission.
        access - the access of the SAFPermission.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if name is empty.
      • SAFPermission

        public SAFPermission(java.lang.String entityName)
        Creates a new SAFPermission with the specified entity _name and default values for securityClass and access.
        Parameters:
        entityName - the entityName of the SAFPermission.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if name is empty.
    • Method Detail

      • implies

        public boolean implies(java.security.Permission p)
        Calls RACF to verify the permission.

        More specifically, this method returns true if:

        RACF returns that the user has the necessary access or false if not.

        Specified by:
        implies in class java.security.Permission
        Parameters:
        p - used to make the check permission call.
        Returns:
        true if RACF allows the access, false otherwise.
      • equals

        public boolean equals(java.lang.Object obj)
        Checks two SAFPermission objects for equality. Checks that obj's class is the same as this object's class and has the same name as this object.

        Specified by:
        equals in class java.security.Permission
        Parameters:
        obj - the object we are testing for equality with this object.
        Returns:
        true if obj is a SAFPermission, and has the same name as this SAFPermission object, false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code value for this object. The hash code used is the hash code of the name, that is, toString().hashCode(), where getName is from the Permission superclass.
        Specified by:
        hashCode in class java.security.Permission
        Returns:
        a hash code value for this object.
      • getActions

        public java.lang.String getActions()
        Returns the Actions value for this object. The Actions are not relevant for a SAFPermission,
        Specified by:
        getActions in class java.security.Permission
        Returns:
        Actions for this object.
      • getSecurityClass

        public java.lang.String getSecurityClass()
        Returns the Security Class for this object from this class.
        Returns:
        a String for the value of securityClass for this object.
      • getAccess

        public java.lang.Integer getAccess()
        Returns the Access for this object. from this class.
        Returns:
        a String for the value of access for this object.
      • toString

        public java.lang.String toString()
        Returns the a String that is a concatenation of the securityClass, the name and the access. This is used for the hashcode.
        Overrides:
        toString in class java.security.Permission
        Returns:
        a String for the value for this object.
      • newPermissionCollection

        public java.security.PermissionCollection newPermissionCollection()
        Returns a new PermissionCollection object for storing SAFPermission objects.

        A SAFPermissionCollection stores a collection of SAFPermission permissions.

        SAFPermission objects must be stored in a manner that allows them to be inserted in any order, but that also enables the PermissionCollection implies method to be implemented in an efficient (and consistent) manner.

        Overrides:
        newPermissionCollection in class java.security.Permission
        Returns:
        a new PermissionCollection object suitable for storing SAFPermissions.
� Portions Copyright 1998, 2016 IBM Corporation. All rights reserved. � Portions Copyright 1992, 2004, Oracle and/or its affiliates. All rights reserved.