次の方法で共有


IndividuallySecurableMetadataObject.SetAccessControlList メソッド (Microsoft.Office.Server.ApplicationRegistry.Administration)

個別にセキュリティ保護可能なメタデータ オブジェクトのアクセス コントロール リストを設定します。

名前空間: Microsoft.Office.Server.ApplicationRegistry.Administration
アセンブリ: Microsoft.SharePoint.Portal (microsoft.sharepoint.portal.dll 内)

構文

'宣言
Public Overridable Sub SetAccessControlList ( _
    acl As IAccessControlList _
)
'使用
Dim instance As IndividuallySecurableMetadataObject
Dim acl As IAccessControlList

instance.SetAccessControlList(acl)
public virtual void SetAccessControlList (
    IAccessControlList acl
)

パラメータ

  • acl
    設定する IAccessControlList オブジェクト。

        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)
            {
            }
        }

関連項目

参照

IndividuallySecurableMetadataObject クラス
IndividuallySecurableMetadataObject メンバ
Microsoft.Office.Server.ApplicationRegistry.Administration 名前空間