com.sas.metadata.remote
Interface MdSecurityUtil

All Superinterfaces:
java.rmi.Remote

public interface MdSecurityUtil
extends java.rmi.Remote

Utility class used for retrieving the necessary security permissions for a metadata object.

An instance of this class should be obtained by calling MdFactory.getSecurityUtil().


Method Summary
 void dispose()
          Destroy all memory allocated for object and release from RMI
 int getAssociationCountForObject(CMetadata meta, java.lang.String associationName)
          Returns the size of a specific association for an object.
 int getCountNoSecurity(java.lang.String reposID, java.lang.String xmlSelect, java.lang.String metadataType)
          Performs a search on the server bypassing all security permissions.
 int getCountNoSecurity(java.lang.String reposID, java.lang.String xmlSelect, java.lang.String metadataType, int flags)
          Performs a search on the server bypassing all security permissions.
 boolean isFolderWriteAuthorized(java.lang.String folderID)
          Returns true if the user has the necessary WriteMemberMetadata permissions for a particular folder.
 boolean isReadAuthorized(java.lang.String metadataType, java.lang.String metadataID)
          Returns true if the user has the necessary ReadMetadata permissions for a particular object.
 boolean isWriteAuthorized(java.lang.String metadataType, java.lang.String metadataID)
          Returns true if the user has the necessary WriteMetadata permissions for a particular object.
 

Method Detail

isReadAuthorized

boolean isReadAuthorized(java.lang.String metadataType,
                         java.lang.String metadataID)
                         throws MdException,
                                java.rmi.RemoteException
Returns true if the user has the necessary ReadMetadata permissions for a particular object.

Parameters:
metadataType - the metadata type of the object
metadataID - the object's metadata id
Returns:
true if user has read metadata permission, false otherwise
Throws:
MdException
java.rmi.RemoteException

isWriteAuthorized

boolean isWriteAuthorized(java.lang.String metadataType,
                          java.lang.String metadataID)
                          throws MdException,
                                 java.rmi.RemoteException
Returns true if the user has the necessary WriteMetadata permissions for a particular object.

Parameters:
metadataType - the metadata type of the object
metadataID - the object's metadata id
Returns:
true if user has write metadata permission, false otherwise
Throws:
MdException
java.rmi.RemoteException

isFolderWriteAuthorized

boolean isFolderWriteAuthorized(java.lang.String folderID)
                                throws MdException,
                                       java.rmi.RemoteException
Returns true if the user has the necessary WriteMemberMetadata permissions for a particular folder. If true, the user has permissions to add/delete objects within a folder.

Parameters:
folderID - the metadata id of the parent folder
Returns:
true if user has write metadata permission, false otherwise
Throws:
MdException
java.rmi.RemoteException

getAssociationCountForObject

int getAssociationCountForObject(CMetadata meta,
                                 java.lang.String associationName)
                                 throws MdException,
                                        java.rmi.RemoteException
Returns the size of a specific association for an object. This method will bypass all security permissions. The count returned will be the size of the association, regardless if the user doesn't have permission to view all objects in the association.

For example, this method can be used to get the number of columns associated to a table or to see if a public object is already contained within a folder.

Parameters:
isec - the ISecurity connection
meta - the metadata object to search for
associationName - the name of the association to search
Returns:
the total size of an association for a given object or 0 if the association is completely empty.
Throws:
MdException
java.rmi.RemoteException

getCountNoSecurity

int getCountNoSecurity(java.lang.String reposID,
                       java.lang.String xmlSelect,
                       java.lang.String metadataType)
                       throws MdException,
                              java.rmi.RemoteException
Performs a search on the server bypassing all security permissions. This method will return a count of all objects that exist on the server, even those that the user doesn't have permission to view.

Parameters:
reposID - the repository id to search within
xmlSelect - an xml select statement used to search for the object
metadataType - the metadata type of the object
Returns:
count the number of objects matching the search criteria that exist on the server
Throws:
MdException
java.rmi.RemoteException

getCountNoSecurity

int getCountNoSecurity(java.lang.String reposID,
                       java.lang.String xmlSelect,
                       java.lang.String metadataType,
                       int flags)
                       throws MdException,
                              java.rmi.RemoteException
Performs a search on the server bypassing all security permissions. This method will return a count of all objects that exist on the server, even those that the user doesn't have permission to view.

This method can be used when needing to search across multiple repositories. In this case, additional flags can be passed in via the flags parameter.

Parameters:
reposID - the repository id to search within
xmlSelect - an xml select statement used to search for the object
metadataType - the metadata type of the object
flags - allows additional flags to be passed in. Typically this can be used to allow users to search across multiple repositories using the MdOMIUtil.OMI_DEPENDENCY_USES and MdOMIUtil.OMI_DEPENDENCY_USEDBY flags. If no additional flags are needed, a value of 0 can be passed in.
Returns:
count the number of objects matching the search criteria that exist on the server
Throws:
MdException
java.rmi.RemoteException

dispose

void dispose()
             throws java.rmi.RemoteException
Destroy all memory allocated for object and release from RMI

Throws:
java.rmi.RemoteException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.