com.esri.arcgis.geodatabase
Class ISQLPrivilegeProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.geodatabase.ISQLPrivilegeProxy
All Implemented Interfaces:
ISQLPrivilege, Externalizable, Serializable

public class ISQLPrivilegeProxy
extends com.esri.arcgis.interop.Dispatch
implements ISQLPrivilege, Serializable

Provides access to members for granting and revoking privileges to database users.

Remarks

The ISQLPrivilege optional interface provides information about the permissions you have on a database object and also the ability to change the permissions for other users. It only applies to those datasets that are stored within an ArcSDE geodatabase. It applies to feature datasets, feature classes, tables, relationship classes, raster datasets, and raster catalogs. ISQLPrivilege cannot be used on datasets contained within a feature dataset, as permissions are managed at the feature dataset level.

The esriSQLPrivilege enumeration defines values that can be used with ISQLPrivilege:

Enumeration esriSQLPrivilege SQL Privileges

1 - esriSelectPrivilege

Select

2 - esriUpdatePrivilege

Update

4 - esriInsertPrivilege

Insert

8 - esriDeletePrivilege

Delete

The values may be bitwise OR'd together if more than one privilege applies (note that this is equal to summing the integer values). For example, if the SQLPrivileges property returns a value of 9, this would mean that you have select and delete permission on the dataset, but not insert or update. A value of 15 indicates full privileges.

The last parameter on Grant is for specifying whether or not the user will have the ability to grant privileges to other users.

Address locators only support esriSelectPrivilege.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
IGPDataType.getFullName(), Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  ISQLPrivilegeProxy()
           
  ISQLPrivilegeProxy(Object obj)
           
protected ISQLPrivilegeProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 int getSQLPrivileges()
          The database privileges.
 void grant(String userName, int privileges, boolean withGrant)
          Grants privileges for the database user.
 void removeListener(String iidStr, Object theListener)
           
 void revoke(String userName, int privileges)
          Revokes privileges for the database user.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

ISQLPrivilegeProxy

public ISQLPrivilegeProxy()

ISQLPrivilegeProxy

public ISQLPrivilegeProxy(Object obj)
                   throws IOException
Throws:
IOException

ISQLPrivilegeProxy

protected ISQLPrivilegeProxy(Object obj,
                             String iid)
                      throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

getSQLPrivileges

public int getSQLPrivileges()
                     throws IOException,
                            AutomationException
The database privileges.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSQLPrivileges in interface ISQLPrivilege
Returns:
The privileges
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

grant

public void grant(String userName,
                  int privileges,
                  boolean withGrant)
           throws IOException,
                  AutomationException
Grants privileges for the database user.

Description

The esriSQLPrivilege enumeration defines privieges that that can be granted with ISQLPrivilege:

Enumeration esriSQLPrivilege SQL Privileges

1 - esriSelectPrivilege

Select

2 - esriUpdatePrivilege

Update

4 - esriInsertPrivilege

Insert

8 - esriDeletePrivilege

Delete

The values may be bitwise OR'd together if more than one privilege applies (note that this is equal to summing the integer values). The dataset name could be a feature dataset, in which case the user would receive privileges on all the contents of the feature dataset.

If TRUE, the withGrant parameter denotes that the user may grant access privileges to other users.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
grant in interface ISQLPrivilege
Parameters:
userName - The userName (in)
privileges - The privileges (in)
withGrant - The withGrant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

revoke

public void revoke(String userName,
                   int privileges)
            throws IOException,
                   AutomationException
Revokes privileges for the database user.

Remarks

The esriSQLPrivilege enumeration defines privieges that that can be revoked with ISQLPrivilege:

Enumeration esriSQLPrivilege SQL Privileges

1 - esriSelectPrivilege

Select

2 - esriUpdatePrivilege

Update

4 - esriInsertPrivilege

Insert

8 - esriDeletePrivilege

Delete

The values may be bitwise OR'd together if more than one priviege applies (note that this is equal to summing the integer values). The dataset name could be a feature dataset, in which case the user would no longer have privileges on the contents of the feature dataset.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
revoke in interface ISQLPrivilege
Parameters:
userName - The userName (in)
privileges - The privileges (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.