com.sas.services.information.metadata
Class AuthorizationUtil

com.sas.services.information.metadata.AuthorizationUtil
All Implemented Interfaces:
AuthorizationBaseInterface, AuthorizationUtilInterface, java.io.Serializable, java.rmi.Remote

public class AuthorizationUtil
implements AuthorizationUtilInterface, java.io.Serializable

Methods for managing authorizations on a protected object

See Also:
Serialized Form

Constructor Summary
AuthorizationUtil(MetadataInterface obj, boolean actDef)
           
 
Method Summary
 void applyACT(AccessControlTemplateInterface act)
          Apply an ACT to protect an object
 void commit()
          Commit Authorization Changes Any pending Authorization changes will be committed on the Server.
 void discard()
          Discard Authorization Changes Any pending Authorization changes will be discarded on the Server.
 java.util.List<AccessControlTemplateInterface> getACTs()
          Get ACTs that protect an object
 java.util.List<java.lang.String> getApplicablePermissions()
          Obtain permissions Applicable to a Protected Object or ACT Permission Pattern based on Object's PublicType We do think it "fits" in this Interface because its useful to know the permissions applicable to an Object's PublicType prior to invoking
 AuthorizationInfoInterface getAuthorizations(IdentityInterface identity, java.util.List<java.lang.String> permissions)
          Get Authorizations
 java.util.List<AuthorizationInfoInterface> getAuthorizations(java.util.List<IdentityInterface> identities, java.util.List<java.lang.String> permissions)
          Get Authorizations
 java.util.List<AuthorizationInfoInterface> getAuthorizationsAll()
          Get Authorizations All
 AuthorizationExplainedInfoInterface getAuthorizationsExplained(IdentityInterface identity, java.util.List<java.lang.String> permissions)
          Get Authorizations with Indirect Authorization Sources Explained
 java.util.List<AuthorizationExplainedInfoInterface> getAuthorizationsExplained(java.util.List<IdentityInterface> identities, java.util.List<java.lang.String> permissions)
          Get Authorizations with Indirect Authorization Sources Explained
 java.util.List<AuthorizationExplainedInfoInterface> getAuthorizationsExplainedAll()
          Get Authorizations with Indirect Authorization Sources Explained All
 boolean getCommitOnUpdate()
          Obtains boolean indicating if Authorization changes are committed when the object is updated
 java.util.List<com.sas.services.information.metadata.AuthorizationIdentityInfoInterface> getIdentityInfo()
          Get Identities
 AuthorizationInheritanceInfoInterface getInheritanceInfo()
          Get Inheritance Info for this object
 void removeACT(AccessControlTemplateInterface act)
          Remove an ACT from protecting an object
 void setAuthorizations(IdentityInterface identity, java.util.List<PermissionInfoInterface> permissionInfoList)
          Set Authorizations
 void setAuthorizations(java.util.List<AuthorizationInfoInterface> authorizations)
          Set Authorizations
 void setCommitOnUpdate(boolean commitOnUpdate)
          Set boolean indicating to Commit Authorization changes when the object is updated
 

Constructor Detail

AuthorizationUtil

public AuthorizationUtil(MetadataInterface obj,
                         boolean actDef)
Method Detail

getCommitOnUpdate

public boolean getCommitOnUpdate()
                          throws ServiceException,
                                 java.rmi.RemoteException
Obtains boolean indicating if Authorization changes are committed when the object is updated

Specified by:
getCommitOnUpdate in interface AuthorizationBaseInterface
Returns:
boolean value indicating if Authorization changes are committed when the object is updated
Throws:
com.sas.metadata.remote.MdException
java.rmi.RemoteException - In the event of remote object failure.
ServiceException

setCommitOnUpdate

public void setCommitOnUpdate(boolean commitOnUpdate)
                       throws ServiceException,
                              java.rmi.RemoteException
Set boolean indicating to Commit Authorization changes when the object is updated

Specified by:
setCommitOnUpdate in interface AuthorizationBaseInterface
Parameters:
boolean - value indicating to Commit Authorization changes when the object is updated
Throws:
com.sas.metadata.remote.MdException
java.rmi.RemoteException - In the event of remote object failure.
ServiceException

getApplicablePermissions

public java.util.List<java.lang.String> getApplicablePermissions()
                                                          throws ServiceException,
                                                                 java.rmi.RemoteException
Obtain permissions Applicable to a Protected Object or ACT Permission Pattern based on Object's PublicType

We do think it "fits" in this Interface because its useful to know the permissions applicable to an Object's PublicType prior to invoking

Specified by:
getApplicablePermissions in interface AuthorizationBaseInterface
Returns:
String Comma delimited list of Permission names
Throws:
ServiceException
java.rmi.RemoteException - In the event of remote object failure.

getIdentityInfo

public java.util.List<com.sas.services.information.metadata.AuthorizationIdentityInfoInterface> getIdentityInfo()
                                                                                                         throws ServiceException,
                                                                                                                java.rmi.RemoteException
Get Identities

Specified by:
getIdentityInfo in interface AuthorizationBaseInterface
Returns:
A List of IdentityInterface objects
Throws:
ServiceException - if a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getAuthorizations

public AuthorizationInfoInterface getAuthorizations(IdentityInterface identity,
                                                    java.util.List<java.lang.String> permissions)
                                             throws java.lang.IllegalArgumentException,
                                                    ServiceException,
                                                    java.rmi.RemoteException
Get Authorizations

Specified by:
getAuthorizations in interface AuthorizationBaseInterface
Parameters:
identity - A single IdentityInterface object to test permissions for. if identity is null then an empty List is returned.
permissions - A List of String objects specifying the permissions to check. If null or an empty List, all applicable permissions for the object are returned.
Returns:
A List of AuthorizationInfoInterface objects '
Throws:
java.lang.IllegalArgumentException - If the identity parameter reference is null
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getAuthorizations

public java.util.List<AuthorizationInfoInterface> getAuthorizations(java.util.List<IdentityInterface> identities,
                                                                    java.util.List<java.lang.String> permissions)
                                                             throws ServiceException,
                                                                    java.rmi.RemoteException
Get Authorizations

Specified by:
getAuthorizations in interface AuthorizationBaseInterface
Parameters:
identities - A List of IdentityInterface objects to test permissions for. If null or an empty list then a List of AuthorizationInfoInterface objects for all identities are returned.
permissions - A List of Strings specifying the permissions to check. If null or an empty List, all applicable permissions for all specified identities on the object represented by this AuthContext instance are returned.
Returns:
A List of AuthorizationInfoInterface objects
Throws:
ServiceException - if a service level error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getAuthorizationsAll

public java.util.List<AuthorizationInfoInterface> getAuthorizationsAll()
                                                                throws ServiceException,
                                                                       java.rmi.RemoteException
Get Authorizations All

Specified by:
getAuthorizationsAll in interface AuthorizationBaseInterface
Returns:
A List of AuthorizationInfoInterface objects
Throws:
ServiceException - if a service level error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getInheritanceInfo

public AuthorizationInheritanceInfoInterface getInheritanceInfo()
                                                         throws ServiceException,
                                                                java.rmi.RemoteException
Get Inheritance Info for this object

Specified by:
getInheritanceInfo in interface AuthorizationUtilInterface
Returns:
The List of AuthorizationInheritanceInfoInterface objects for the first level parents of this object. Each element on this list contains a nested list of AuthorizationInheritanceInfoInterface objects which collectively represent the authorization inheritance "tree" for this object.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getAuthorizationsExplained

public AuthorizationExplainedInfoInterface getAuthorizationsExplained(IdentityInterface identity,
                                                                      java.util.List<java.lang.String> permissions)
                                                               throws java.lang.IllegalArgumentException,
                                                                      ServiceException,
                                                                      java.rmi.RemoteException
Get Authorizations with Indirect Authorization Sources Explained

Specified by:
getAuthorizationsExplained in interface AuthorizationBaseInterface
Parameters:
identity - A single IdentityInterface object representing a User, Group, or Role for which permissions are sought.
permissions - A List of String objects where each string specifies a requested permissions. If the List is null or empty, all applicable permissions for all identities corresponding to authorizations on the object are returned.
Returns:
A List of PermissionExplainedInfoInterface objects with the resulting authorization data.
Throws:
java.lang.IllegalArgumentException - If the Identity parameter reference is null
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getAuthorizationsExplained

public java.util.List<AuthorizationExplainedInfoInterface> getAuthorizationsExplained(java.util.List<IdentityInterface> identities,
                                                                                      java.util.List<java.lang.String> permissions)
                                                                               throws ServiceException,
                                                                                      java.rmi.RemoteException
Get Authorizations with Indirect Authorization Sources Explained

Specified by:
getAuthorizationsExplained in interface AuthorizationBaseInterface
Parameters:
identities - A List of IdentityInterface objects representing the Users, Groups, or Roles for which permissions are sought. If the List is null or empty, Permissions for all relevant identities are returned.
permissions - A List of String objects where each string specifies a requested permissions. If the List is null or empty, all applicable permissions for all identities corresponding to authorizations on the object are returned.
Returns:
A List of AuthorizationExplainedInfoInterface objects with the resulting authorization data.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getAuthorizationsExplainedAll

public java.util.List<AuthorizationExplainedInfoInterface> getAuthorizationsExplainedAll()
                                                                                  throws ServiceException,
                                                                                         java.rmi.RemoteException
Get Authorizations with Indirect Authorization Sources Explained All

Specified by:
getAuthorizationsExplainedAll in interface AuthorizationBaseInterface
Returns:
A List of AuthorizationExplainedInfoInterface objects with the resulting authorization data.
Throws:
ServiceException - if a service level error occurs.
java.rmi.RemoteException - in the event of remote object failure.

setAuthorizations

public void setAuthorizations(IdentityInterface identity,
                              java.util.List<PermissionInfoInterface> permissionInfoList)
                       throws java.lang.IllegalArgumentException,
                              ServiceException,
                              java.rmi.RemoteException
Set Authorizations

Specified by:
setAuthorizations in interface AuthorizationBaseInterface
Parameters:
identity - An IdentityInterface object representing the Identity for which permissions are set
permissions - A List of PermissionInfoInterface instances describing the permission(s) to set
Throws:
java.lang.IllegalArgumentException - If the Identity parameter reference is null If the permissionInfoList parameter reference is null
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

setAuthorizations

public void setAuthorizations(java.util.List<AuthorizationInfoInterface> authorizations)
                       throws ServiceException,
                              java.rmi.RemoteException
Set Authorizations

Specified by:
setAuthorizations in interface AuthorizationBaseInterface
Parameters:
authorizations - A List of AuthorizationInfoInterface objects defining the authorizations to set on the object
Throws:
java.lang.IllegalArgumentException - If the authorizations List parameter reference is null
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getACTs

public java.util.List<AccessControlTemplateInterface> getACTs()
                                                       throws ServiceException,
                                                              java.rmi.RemoteException
Get ACTs that protect an object

Specified by:
getACTs in interface AuthorizationUtilInterface
Returns:
A List of AccessControlTemplateInterface objects representing the ACT's associated to the object.
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of a remote object failure.

applyACT

public void applyACT(AccessControlTemplateInterface act)
              throws java.lang.IllegalArgumentException,
                     ServiceException,
                     java.rmi.RemoteException
Apply an ACT to protect an object

Specified by:
applyACT in interface AuthorizationUtilInterface
Parameters:
act - An AccessControlTemplateInterface object for the ACT being applied.
Throws:
java.lang.IllegalArgumentException - If the authorizations act parameter reference is null
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of a remote object failure.

removeACT

public void removeACT(AccessControlTemplateInterface act)
               throws java.lang.IllegalArgumentException,
                      ServiceException,
                      java.rmi.RemoteException
Remove an ACT from protecting an object

Specified by:
removeACT in interface AuthorizationUtilInterface
Parameters:
act - An AccessControlTemplateInterface object for the ACT being removed.
Throws:
java.lang.IllegalArgumentException - If the authorizations act parameter reference is null
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of a remote object failure.

commit

public void commit()
            throws ServiceException,
                   java.rmi.RemoteException
Description copied from interface: AuthorizationBaseInterface
Commit Authorization Changes Any pending Authorization changes will be committed on the Server. Current Authorization state will be reset for the corresponding object.

Specified by:
commit in interface AuthorizationBaseInterface
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of a remote object failure.

discard

public void discard()
             throws ServiceException,
                    java.rmi.RemoteException
Description copied from interface: AuthorizationBaseInterface
Discard Authorization Changes Any pending Authorization changes will be discarded on the Server. Current Authorization state will be reset for the corresponding object.

Specified by:
discard in interface AuthorizationBaseInterface
Throws:
ServiceException - If a service level error occurs.
java.rmi.RemoteException - In the event of a remote object failure.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.