Geographic Information Systems Asked by furier on December 10, 2020
How can I with ArcObjects GRANT or REVOKE Privileges like SELECT, UPDATE on SDE FeatureClasses to/from Roles?
The equivalent in normal Oracle would be something like this:
GRANT SELECT ON SCHEMA.TABLE TO SOME_ROLE;
REVOKE SELECT ON SCHEMA.TABLE FROM SOME_ROLE;
I can’t seem to find the interface to perform this task, and it may not exists?
My dream would be to have an Interface like this:
public interface IPrivilegeManager
{
void Grant(string privilegeName, string schemaOwnerName, string featureClassName, string roleName);
void Revoke(string privilegeName, string schemaOwnerName, string featureClassName, string roleName);
}
You can obtain the name object for the given feature class and cast it to ISQLPrivilege, which allows you to enumerate, grant and revoke permissions.
E.g.:
var name = ((IDataset) featureClass).FullName;
var sqlPrivilege = name as ISQLPrivilege;
if (sqlPrivilege != null)
{
sqlPrivilege.Grant("USER_OR_ROLE_NAME", (int) esriSQLPrivilege.esriSelectPrivilege, false);
}
Correct answer by Petr Krebs on December 10, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP