FileSystemAccessRuleとは? わかりやすく解説

FileSystemAccessRule クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

ファイルまたはディレクトリアクセス規則定義するアクセス制御エントリ (ACE: Access Control Entry) の抽象化表します。このクラス継承できません。

名前空間: System.Security.AccessControl
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public NotInheritable Class
 FileSystemAccessRule
    Inherits AccessRule
Dim instance As FileSystemAccessRule
public sealed class FileSystemAccessRule :
 AccessRule
public ref class FileSystemAccessRule sealed
 : public AccessRule
public final class FileSystemAccessRule extends
 AccessRule
public final class FileSystemAccessRule extends
 AccessRule
解説解説
使用例使用例

FileSecurity クラス使用してファイルアクセス制御エントリ (ACE) を追加し次にファイルかACE削除するコード例次に示します。この例を実行するには、有効なユーザー アカウントまたはグループ アカウント指定する必要があります

Imports System
Imports System.IO
Imports System.Security.AccessControl



Module FileExample

    Sub Main()
        Try
            Dim fileName As String
 = "test.xml"

            Console.WriteLine("Adding access control entry for
 " & fileName)

            ' Add the access control entry to the file.
            AddFileSecurity(fileName, "DomainName\AccountName",
 _
                FileSystemRights.ReadData, AccessControlType.Allow)

            Console.WriteLine("Removing access control entry from
 " & fileName)

            ' Remove the access control entry from the file.
            RemoveFileSecurity(fileName, "DomainName\AccountName",
 _
                FileSystemRights.ReadData, AccessControlType.Allow)

            Console.WriteLine("Done.")
        Catch e As Exception
            Console.WriteLine(e)
        End Try

    End Sub


    ' Adds an ACL entry on the specified file for the specified account.
    Sub AddFileSecurity(ByVal fileName As
 String, ByVal account As
 String, _
        ByVal rights As FileSystemRights, ByVal
 controlType As AccessControlType)
  
        ' Get a FileSecurity object that represents the 
        ' current security settings.
        Dim fSecurity As FileSecurity = File.GetAccessControl(fileName)

        ' Add the FileSystemAccessRule to the security settings. 
        Dim accessRule As FileSystemAccessRule
 = _
            New FileSystemAccessRule(account, rights, controlType)

        fSecurity.AddAccessRule(accessRule)

        ' Set the new access settings.
        File.SetAccessControl(fileName, fSecurity)

    End Sub


    ' Removes an ACL entry on the specified file for the specified account.
    Sub RemoveFileSecurity(ByVal fileName As
 String, ByVal account As
 String, _
        ByVal rights As FileSystemRights, ByVal
 controlType As AccessControlType)

        ' Get a FileSecurity object that represents the 
        ' current security settings.
        Dim fSecurity As FileSecurity = File.GetAccessControl(fileName)

        ' Add the FileSystemAccessRule to the security settings. 
        fSecurity.RemoveAccessRule(New FileSystemAccessRule(account,
 _
            rights, controlType))

        ' Set the new access settings.
        File.SetAccessControl(fileName, fSecurity)

    End Sub
End Module
using System;
using System.IO;
using System.Security.AccessControl;

namespace FileSystemExample
{
    class FileExample
    {
        public static void
 Main()
        {
            try
            {
                string fileName = "test.xml";

                Console.WriteLine("Adding access control entry for
 " 
                    + fileName);

                // Add the access control entry to the file.
                AddFileSecurity(fileName, @"DomainName\AccountName",
                    FileSystemRights.ReadData, AccessControlType.Allow);

                Console.WriteLine("Removing access control entry from "
 
                    + fileName);

                // Remove the access control entry from the file.
                RemoveFileSecurity(fileName, @"DomainName\AccountName",
 
                    FileSystemRights.ReadData, AccessControlType.Allow);

                Console.WriteLine("Done.");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }

        // Adds an ACL entry on the specified file for the specified
 account.
        public static void
 AddFileSecurity(string fileName, string account,
 
            FileSystemRights rights, AccessControlType controlType)
        {
            

            // Get a FileSecurity object that represents the 
            // current security settings.
            FileSecurity fSecurity = File.GetAccessControl(fileName);

            // Add the FileSystemAccessRule to the security settings.
 
            fSecurity.AddAccessRule(new FileSystemAccessRule(account
,
                rights, controlType));

            // Set the new access settings.
            File.SetAccessControl(fileName, fSecurity);

        }

        // Removes an ACL entry on the specified file for the specified
 account.
        public static void
 RemoveFileSecurity(string fileName, string
 account, 
            FileSystemRights rights, AccessControlType controlType)
        {

            // Get a FileSecurity object that represents the 
            // current security settings.
            FileSecurity fSecurity = File.GetAccessControl(fileName);

            // Add the FileSystemAccessRule to the security settings.
 
            fSecurity.RemoveAccessRule(new FileSystemAccessRule(account
,
                rights, controlType));

            // Set the new access settings.
            File.SetAccessControl(fileName, fSecurity);

        }
    }
}
using namespace System;
using namespace System::IO;
using namespace System::Security::AccessControl;

// Adds an ACL entry on the specified file for the specified account.

void AddFileSecurity(String^ fileName, String^ account, 
                        FileSystemRights rights, AccessControlType controlType)
{
    // Get a FileSecurity object that represents the 
    // current security settings.
    FileSecurity^ fSecurity = File::GetAccessControl(fileName);

    // Add the FileSystemAccessRule to the security settings. 
    fSecurity->AddAccessRule(gcnew FileSystemAccessRule
                                   (account,rights, controlType));

    // Set the new access settings.
    File::SetAccessControl(fileName, fSecurity);
}

// Removes an ACL entry on the specified file for the specified account.

void RemoveFileSecurity(String^ fileName, String^ account, 
                        FileSystemRights rights, AccessControlType controlType)
{

    // Get a FileSecurity object that represents the 
    // current security settings.
    FileSecurity^ fSecurity = File::GetAccessControl(fileName);

    // Remove the FileSystemAccessRule to the security settings. 
    fSecurity->RemoveAccessRule(gcnew FileSystemAccessRule
                                      (account,rights, controlType));

    // Set the new access settings.
    File::SetAccessControl(fileName, fSecurity);
}

int main()
{
    try
    {
        String^ fileName = "test.xml";

        Console::WriteLine("Adding access control entry for
 " + fileName);

        // Add the access control entry to the file.
        AddFileSecurity(fileName, "MYDOMAIN\\MyAccount", 
            FileSystemRights::ReadData, AccessControlType::Allow);

        Console::WriteLine("Removing access control entry from " + fileName);

        // Remove the access control entry from the file.
        RemoveFileSecurity(fileName, "MYDOMAIN\\MyAccount", 
            FileSystemRights::ReadData, AccessControlType::Allow);

        Console::WriteLine("Done.");
    }
    catch (Exception^ ex)
    {
        Console::WriteLine(ex->Message);
    }
}

継承階層継承階層
System.Object
   System.Security.AccessControl.AuthorizationRule
     System.Security.AccessControl.AccessRule
      System.Security.AccessControl.FileSystemAccessRule
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FileSystemAccessRule メンバ
System.Security.AccessControl 名前空間

FileSystemAccessRule コンストラクタ (IdentityReference, FileSystemRights, AccessControlType)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

ユーザー アカウントへの参照アクセス規則関連付けられた操作種類指定する値、およびその操作許可する拒否するかを指定する値を使用して、FileSystemAccessRule クラス新しインスタンス初期化します。

名前空間: System.Security.AccessControl
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    identity As IdentityReference, _
    fileSystemRights As FileSystemRights, _
    type As AccessControlType _
)
Dim identity As IdentityReference
Dim fileSystemRights As FileSystemRights
Dim type As AccessControlType

Dim instance As New FileSystemAccessRule(identity,
 fileSystemRights, type)
public FileSystemAccessRule (
    IdentityReference identity,
    FileSystemRights fileSystemRights,
    AccessControlType type
)
public:
FileSystemAccessRule (
    IdentityReference^ identity, 
    FileSystemRights fileSystemRights, 
    AccessControlType type
)
public FileSystemAccessRule (
    IdentityReference identity, 
    FileSystemRights fileSystemRights, 
    AccessControlType type
)
public function FileSystemAccessRule (
    identity : IdentityReference, 
    fileSystemRights : FileSystemRights, 
    type : AccessControlType
)

パラメータ

identity

ユーザー アカウントへの参照カプセル化する IdentityReference オブジェクト

fileSystemRights

アクセス規則関連付けられた操作種類指定する FileSystemRights 値のいずれか

type

操作許可する拒否するかを指定する AccessControlType 値のいずれか

例外例外
例外種類条件

ArgumentException

identity パラメータIdentityReference オブジェクトではありません。

ArgumentNullException

identity パラメータnull 参照 (Visual Basic では Nothing) です。

ArgumentOutOfRangeException

type パラメータ誤った列挙体が渡されました。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FileSystemAccessRule クラス
FileSystemAccessRule メンバ
System.Security.AccessControl 名前空間

FileSystemAccessRule コンストラクタ (IdentityReference, FileSystemRights, InheritanceFlags, PropagationFlags, AccessControlType)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

ユーザー アカウントへの参照アクセス規則関連付けられた操作種類指定する値、権限継承方法決定する値、権限反映方法決定する値、および操作許可する拒否するかを指定する値を使用して、FileSystemAccessRule クラス新しインスタンス初期化します。

名前空間: System.Security.AccessControl
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    identity As IdentityReference, _
    fileSystemRights As FileSystemRights, _
    inheritanceFlags As InheritanceFlags, _
    propagationFlags As PropagationFlags, _
    type As AccessControlType _
)
Dim identity As IdentityReference
Dim fileSystemRights As FileSystemRights
Dim inheritanceFlags As InheritanceFlags
Dim propagationFlags As PropagationFlags
Dim type As AccessControlType

Dim instance As New FileSystemAccessRule(identity,
 fileSystemRights, inheritanceFlags, propagationFlags, type)
public FileSystemAccessRule (
    IdentityReference identity,
    FileSystemRights fileSystemRights,
    InheritanceFlags inheritanceFlags,
    PropagationFlags propagationFlags,
    AccessControlType type
)
public:
FileSystemAccessRule (
    IdentityReference^ identity, 
    FileSystemRights fileSystemRights, 
    InheritanceFlags inheritanceFlags, 
    PropagationFlags propagationFlags, 
    AccessControlType type
)
public FileSystemAccessRule (
    IdentityReference identity, 
    FileSystemRights fileSystemRights, 
    InheritanceFlags inheritanceFlags, 
    PropagationFlags propagationFlags, 
    AccessControlType type
)
public function FileSystemAccessRule (
    identity : IdentityReference, 
    fileSystemRights : FileSystemRights, 
    inheritanceFlags : InheritanceFlags, 
    propagationFlags : PropagationFlags, 
    type : AccessControlType
)

パラメータ

identity

ユーザー アカウントへの参照カプセル化する IdentityReference オブジェクト

fileSystemRights

アクセス規則関連付けられた操作種類指定する FileSystemRights 値のいずれか

inheritanceFlags

オブジェクトアクセス マスク反映する方法指定する InheritanceFlags 値のいずれか

propagationFlags

オブジェクトアクセス制御エントリ (ACE) を反映する方法指定する PropagationFlags 値のいずれか

type

操作許可する拒否するかを指定する AccessControlType 値のいずれか

例外例外
例外種類条件

ArgumentException

identity パラメータIdentityReference オブジェクトではありません。

ArgumentNullException

identity パラメータnull 参照 (Visual Basic では Nothing) です。

ArgumentOutOfRangeException

type パラメータ誤った列挙体が渡されました。

または

inheritanceFlags パラメータ誤った列挙体が渡されました。

または

propagationFlags パラメータ誤った列挙体が渡されました。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FileSystemAccessRule クラス
FileSystemAccessRule メンバ
System.Security.AccessControl 名前空間

FileSystemAccessRule コンストラクタ (String, FileSystemRights, InheritanceFlags, PropagationFlags, AccessControlType)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

ユーザー アカウント名、アクセス規則関連付けられた操作種類指定する値、権限継承方法決定する値、権限反映方法決定する値、および操作許可する拒否するかを指定する値を使用して、FileSystemAccessRule クラス新しインスタンス初期化します。

名前空間: System.Security.AccessControl
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    identity As String, _
    fileSystemRights As FileSystemRights, _
    inheritanceFlags As InheritanceFlags, _
    propagationFlags As PropagationFlags, _
    type As AccessControlType _
)
Dim identity As String
Dim fileSystemRights As FileSystemRights
Dim inheritanceFlags As InheritanceFlags
Dim propagationFlags As PropagationFlags
Dim type As AccessControlType

Dim instance As New FileSystemAccessRule(identity,
 fileSystemRights, inheritanceFlags, propagationFlags, type)
public FileSystemAccessRule (
    string identity,
    FileSystemRights fileSystemRights,
    InheritanceFlags inheritanceFlags,
    PropagationFlags propagationFlags,
    AccessControlType type
)
public:
FileSystemAccessRule (
    String^ identity, 
    FileSystemRights fileSystemRights, 
    InheritanceFlags inheritanceFlags, 
    PropagationFlags propagationFlags, 
    AccessControlType type
)
public FileSystemAccessRule (
    String identity, 
    FileSystemRights fileSystemRights, 
    InheritanceFlags inheritanceFlags, 
    PropagationFlags propagationFlags, 
    AccessControlType type
)
public function FileSystemAccessRule (
    identity : String, 
    fileSystemRights : FileSystemRights, 
    inheritanceFlags : InheritanceFlags, 
    propagationFlags : PropagationFlags, 
    type : AccessControlType
)

パラメータ

identity

ユーザー アカウント名。

fileSystemRights

アクセス規則関連付けられた操作種類指定する FileSystemRights 値のいずれか

inheritanceFlags

オブジェクトアクセス マスク反映する方法指定する InheritanceFlags 値のいずれか

propagationFlags

オブジェクトアクセス制御エントリ (ACE) を反映する方法指定する PropagationFlags 値のいずれか

type

操作許可する拒否するかを指定する AccessControlType 値のいずれか

例外例外
例外種類条件

ArgumentNullException

identity パラメータnull 参照 (Visual Basic では Nothing) です。

ArgumentOutOfRangeException

type パラメータ誤った列挙体が渡されました。

または

inheritanceFlags パラメータ誤った列挙体が渡されました。

または

propagationFlags パラメータ誤った列挙体が渡されました。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FileSystemAccessRule クラス
FileSystemAccessRule メンバ
System.Security.AccessControl 名前空間

FileSystemAccessRule コンストラクタ

FileSystemAccessRule クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
FileSystemAccessRule (IdentityReference, FileSystemRights, AccessControlType) ユーザー アカウントへの参照アクセス規則関連付けられた操作種類指定する値、およびその操作許可する拒否するかを指定する値を使用してFileSystemAccessRule クラス新しインスタンス初期化します。
FileSystemAccessRule (String, FileSystemRights, AccessControlType) ユーザー アカウントの名前、アクセス規則関連付けられた操作種類指定する値、およびその操作許可する拒否するかを示す値を使用してFileSystemAccessRule クラス新しインスタンス初期化します。
FileSystemAccessRule (IdentityReference, FileSystemRights, InheritanceFlags, PropagationFlags, AccessControlType) ユーザー アカウントへの参照アクセス規則関連付けられた操作種類指定する値、権限継承方法決定する値、権限反映方法決定する値、および操作許可する拒否するかを指定する値を使用してFileSystemAccessRule クラス新しインスタンス初期化します。
FileSystemAccessRule (String, FileSystemRights, InheritanceFlags, PropagationFlags, AccessControlType) ユーザー アカウント名、アクセス規則関連付けられた操作種類指定する値、権限継承方法決定する値、権限反映方法決定する値、および操作許可する拒否するかを指定する値を使用してFileSystemAccessRule クラス新しインスタンス初期化します。
参照参照

関連項目

FileSystemAccessRule クラス
FileSystemAccessRule メンバ
System.Security.AccessControl 名前空間

FileSystemAccessRule コンストラクタ (String, FileSystemRights, AccessControlType)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

ユーザー アカウントの名前、アクセス規則関連付けられた操作種類指定する値、およびその操作許可する拒否するかを示す値を使用して、FileSystemAccessRule クラス新しインスタンス初期化します。

名前空間: System.Security.AccessControl
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    identity As String, _
    fileSystemRights As FileSystemRights, _
    type As AccessControlType _
)
Dim identity As String
Dim fileSystemRights As FileSystemRights
Dim type As AccessControlType

Dim instance As New FileSystemAccessRule(identity,
 fileSystemRights, type)
public FileSystemAccessRule (
    string identity,
    FileSystemRights fileSystemRights,
    AccessControlType type
)
public:
FileSystemAccessRule (
    String^ identity, 
    FileSystemRights fileSystemRights, 
    AccessControlType type
)
public FileSystemAccessRule (
    String identity, 
    FileSystemRights fileSystemRights, 
    AccessControlType type
)
public function FileSystemAccessRule (
    identity : String, 
    fileSystemRights : FileSystemRights, 
    type : AccessControlType
)

パラメータ

identity

ユーザー アカウント名。

fileSystemRights

アクセス規則関連付けられた操作種類指定する FileSystemRights 値のいずれか

type

操作許可する拒否するかを指定する AccessControlType 値のいずれか

例外例外
例外種類条件

ArgumentNullException

identity パラメータnull 参照 (Visual Basic では Nothing) です。

ArgumentOutOfRangeException

type パラメータ誤った列挙体が渡されました。

解説解説
使用例使用例

FileSecurity クラス使用してファイルアクセス制御エントリ (ACE) を追加し次にファイルかACE削除するコード例次に示します。この例を実行するには、有効なユーザー アカウントまたはグループ アカウント指定する必要があります

Imports System
Imports System.IO
Imports System.Security.AccessControl



Module FileExample

    Sub Main()
        Try
            Dim fileName As String
 = "test.xml"

            Console.WriteLine("Adding access control entry for
 " & fileName)

            ' Add the access control entry to the file.
            AddFileSecurity(fileName, "DomainName\AccountName",
 _
                FileSystemRights.ReadData, AccessControlType.Allow)

            Console.WriteLine("Removing access control entry from
 " & fileName)

            ' Remove the access control entry from the file.
            RemoveFileSecurity(fileName, "DomainName\AccountName",
 _
                FileSystemRights.ReadData, AccessControlType.Allow)

            Console.WriteLine("Done.")
        Catch e As Exception
            Console.WriteLine(e)
        End Try

    End Sub


    ' Adds an ACL entry on the specified file for the specified account.
    Sub AddFileSecurity(ByVal fileName As
 String, ByVal account As
 String, _
        ByVal rights As FileSystemRights, ByVal
 controlType As AccessControlType)
  
        ' Get a FileSecurity object that represents the 
        ' current security settings.
        Dim fSecurity As FileSecurity = File.GetAccessControl(fileName)

        ' Add the FileSystemAccessRule to the security settings. 
        Dim accessRule As FileSystemAccessRule
 = _
            New FileSystemAccessRule(account, rights, controlType)

        fSecurity.AddAccessRule(accessRule)

        ' Set the new access settings.
        File.SetAccessControl(fileName, fSecurity)

    End Sub


    ' Removes an ACL entry on the specified file for the specified account.
    Sub RemoveFileSecurity(ByVal fileName As
 String, ByVal account As
 String, _
        ByVal rights As FileSystemRights, ByVal
 controlType As AccessControlType)

        ' Get a FileSecurity object that represents the 
        ' current security settings.
        Dim fSecurity As FileSecurity = File.GetAccessControl(fileName)

        ' Add the FileSystemAccessRule to the security settings. 
        fSecurity.RemoveAccessRule(New FileSystemAccessRule(account,
 _
            rights, controlType))

        ' Set the new access settings.
        File.SetAccessControl(fileName, fSecurity)

    End Sub
End Module
using System;
using System.IO;
using System.Security.AccessControl;

namespace FileSystemExample
{
    class FileExample
    {
        public static void
 Main()
        {
            try
            {
                string fileName = "test.xml";

                Console.WriteLine("Adding access control entry for
 " 
                    + fileName);

                // Add the access control entry to the file.
                AddFileSecurity(fileName, @"DomainName\AccountName",
                    FileSystemRights.ReadData, AccessControlType.Allow);

                Console.WriteLine("Removing access control entry from "
 
                    + fileName);

                // Remove the access control entry from the file.
                RemoveFileSecurity(fileName, @"DomainName\AccountName",
 
                    FileSystemRights.ReadData, AccessControlType.Allow);

                Console.WriteLine("Done.");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }

        // Adds an ACL entry on the specified file for the specified
 account.
        public static void
 AddFileSecurity(string fileName, string account,
 
            FileSystemRights rights, AccessControlType controlType)
        {
            

            // Get a FileSecurity object that represents the 
            // current security settings.
            FileSecurity fSecurity = File.GetAccessControl(fileName);

            // Add the FileSystemAccessRule to the security settings.
 
            fSecurity.AddAccessRule(new FileSystemAccessRule(account
,
                rights, controlType));

            // Set the new access settings.
            File.SetAccessControl(fileName, fSecurity);

        }

        // Removes an ACL entry on the specified file for the specified
 account.
        public static void
 RemoveFileSecurity(string fileName, string
 account, 
            FileSystemRights rights, AccessControlType controlType)
        {

            // Get a FileSecurity object that represents the 
            // current security settings.
            FileSecurity fSecurity = File.GetAccessControl(fileName);

            // Add the FileSystemAccessRule to the security settings.
 
            fSecurity.RemoveAccessRule(new FileSystemAccessRule(account
,
                rights, controlType));

            // Set the new access settings.
            File.SetAccessControl(fileName, fSecurity);

        }
    }
}
using namespace System;
using namespace System::IO;
using namespace System::Security::AccessControl;

// Adds an ACL entry on the specified file for the specified account.

void AddFileSecurity(String^ fileName, String^ account, 
                        FileSystemRights rights, AccessControlType controlType)
{
    // Get a FileSecurity object that represents the 
    // current security settings.
    FileSecurity^ fSecurity = File::GetAccessControl(fileName);

    // Add the FileSystemAccessRule to the security settings. 
    fSecurity->AddAccessRule(gcnew FileSystemAccessRule
                                   (account,rights, controlType));

    // Set the new access settings.
    File::SetAccessControl(fileName, fSecurity);
}

// Removes an ACL entry on the specified file for the specified account.

void RemoveFileSecurity(String^ fileName, String^ account, 
                        FileSystemRights rights, AccessControlType controlType)
{

    // Get a FileSecurity object that represents the 
    // current security settings.
    FileSecurity^ fSecurity = File::GetAccessControl(fileName);

    // Remove the FileSystemAccessRule to the security settings. 
    fSecurity->RemoveAccessRule(gcnew FileSystemAccessRule
                                      (account,rights, controlType));

    // Set the new access settings.
    File::SetAccessControl(fileName, fSecurity);
}

int main()
{
    try
    {
        String^ fileName = "test.xml";

        Console::WriteLine("Adding access control entry for
 " + fileName);

        // Add the access control entry to the file.
        AddFileSecurity(fileName, "MYDOMAIN\\MyAccount", 
            FileSystemRights::ReadData, AccessControlType::Allow);

        Console::WriteLine("Removing access control entry from " + fileName);

        // Remove the access control entry from the file.
        RemoveFileSecurity(fileName, "MYDOMAIN\\MyAccount", 
            FileSystemRights::ReadData, AccessControlType::Allow);

        Console::WriteLine("Done.");
    }
    catch (Exception^ ex)
    {
        Console::WriteLine(ex->Message);
    }
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FileSystemAccessRule クラス
FileSystemAccessRule メンバ
System.Security.AccessControl 名前空間

FileSystemAccessRule プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ AccessControlType  この AccessRule オブジェクト関連付けられている AccessControlType 値を取得します。 ( AccessRule から継承されます。)
パブリック プロパティ FileSystemRights 現在の FileSystemAccessRule オブジェクト関連付けられている FileSystemRights フラグ取得します
パブリック プロパティ IdentityReference  この規則適用する IdentityReference を取得します。 ( AuthorizationRule から継承されます。)
パブリック プロパティ InheritanceFlags  この規則を子オブジェクト継承する方法決定するフラグの値を取得します。 ( AuthorizationRule から継承されます。)
パブリック プロパティ IsInherited  この規則明示的に設定するか、または親コンテナ オブジェクトから継承するかを指定する値を取得します。 ( AuthorizationRule から継承されます。)
パブリック プロパティ PropagationFlags  反映フラグの値を取得します。このフラグから、この規則を子オブジェクト反映させる方法判断します。このプロパティ重要なのは、InheritanceFlags 列挙体の値が None でない場合だけです。 ( AuthorizationRule から継承されます。)
参照参照

関連項目

FileSystemAccessRule クラス
System.Security.AccessControl 名前空間

FileSystemAccessRule メソッド


FileSystemAccessRule メンバ

ファイルまたはディレクトリアクセス規則定義するアクセス制御エントリ (ACE: Access Control Entry) の抽象化表します。このクラス継承できません。

FileSystemAccessRule データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド FileSystemAccessRule オーバーロードされます。 FileSystemAccessRule クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ AccessControlType  この AccessRule オブジェクト関連付けられている AccessControlType 値を取得します。(AccessRule から継承されます。)
パブリック プロパティ FileSystemRights 現在の FileSystemAccessRule オブジェクト関連付けられている FileSystemRights フラグ取得します
パブリック プロパティ IdentityReference  この規則適用する IdentityReference を取得します。(AuthorizationRule から継承されます。)
パブリック プロパティ InheritanceFlags  この規則を子オブジェクト継承する方法決定するフラグの値を取得します。(AuthorizationRule から継承されます。)
パブリック プロパティ IsInherited  この規則明示的に設定するか、または親コンテナ オブジェクトから継承するかを指定する値を取得します。(AuthorizationRule から継承されます。)
パブリック プロパティ PropagationFlags  反映フラグの値を取得します。このフラグから、この規則を子オブジェクト反映させる方法判断します。このプロパティ重要なのは、InheritanceFlags 列挙体の値が None でない場合だけです。(AuthorizationRule から継承されます。)
パブリック メソッドパブリック メソッド
参照参照

関連項目

FileSystemAccessRule クラス
System.Security.AccessControl 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からFileSystemAccessRuleを検索した結果を表示しています。
Weblioに収録されているすべての辞書からFileSystemAccessRuleを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からFileSystemAccessRule を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「FileSystemAccessRule」の関連用語

FileSystemAccessRuleのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



FileSystemAccessRuleのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS