Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets the access control list for an individually securable metadata object.
Namespace: Microsoft.Office.Server.ApplicationRegistry.Administration
Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)
Syntax
'Declaration
Public Overridable Sub SetAccessControlList ( _
acl As IAccessControlList _
)
'Usage
Dim instance As IndividuallySecurableMetadataObject
Dim acl As IAccessControlList
instance.SetAccessControlList(acl)
public virtual void SetAccessControlList(
IAccessControlList acl
)
Parameters
- acl
Type: Microsoft.Office.Server.ApplicationRegistry.Infrastructure.IAccessControlList
The IAccessControlList object to set.
Examples
public static void SetAccessControlListForCurrentUser()
{
LobSystemInstance mySysInstance = null;
LobSystemInstanceCollection sysInsCollection = ApplicationRegistry.Instance.GetLobSystemInstancesLikeName("AdventureWorksSampleFromCode");
foreach (LobSystemInstance sysInstance in sysInsCollection)
{
if (sysInstance.Name == "AdventureWorksSampleFromCode")
{
mySysInstance = sysInstance;
break;
}
}
LobSystem ls = mySysInstance.LobSystem;
IAccessControlList acl = new BdcAccessControlList();
String currentIdentity = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
acl.Add(new IndividualAccessControlEntry(currentIdentity, BdcRights.SetPermissions | BdcRights.Execute | BdcRights.Edit | BdcRights.UseInBusinessDataInLists | BdcRights.UseInWebParts));
try
{
ls.SetAccessControlList(acl);
}
catch (AccessDeniedException)
{
}
}
public static void SetAccessControlList()
{
LobSystemInstance mySysInstance = null;
LobSystemInstanceCollection sysInsCollection = ApplicationRegistry.Instance.GetLobSystemInstancesLikeName("AdventureWorksSampleFromCode");
foreach (LobSystemInstance sysInstance in sysInsCollection)
{
if (sysInstance.Name == "AdventureWorksSampleFromCode")
{
mySysInstance = sysInstance;
break;
}
}
LobSystem ls = mySysInstance.LobSystem;
IAccessControlList acl = ls.GetAccessControlList();
String currentIdentity = "Redmond\\umas";
acl.Add(new IndividualAccessControlEntry(currentIdentity, BdcRights.SetPermissions | BdcRights.Execute | BdcRights.Edit | BdcRights.UseInBusinessDataInLists | BdcRights.UseInWebParts));
try
{
ls.SetAccessControlList(acl);
}
catch (AccessDeniedException)
{
}
}
See Also
Reference
IndividuallySecurableMetadataObject Class
IndividuallySecurableMetadataObject Members
Microsoft.Office.Server.ApplicationRegistry.Administration Namespace