FileSystemSecurity.SetAccessRule(FileSystemAccessRule) Metoda

Definicja

Ustawia określone uprawnienie listy kontroli dostępu (ACL) dla bieżącego pliku lub katalogu.

public:
 void SetAccessRule(System::Security::AccessControl::FileSystemAccessRule ^ rule);
public void SetAccessRule (System.Security.AccessControl.FileSystemAccessRule rule);
override this.SetAccessRule : System.Security.AccessControl.FileSystemAccessRule -> unit
Public Sub SetAccessRule (rule As FileSystemAccessRule)

Parametry

rule
FileSystemAccessRule

FileSystemAccessRule Obiekt reprezentujący uprawnienie listy kontroli dostępu (ACL) do ustawiania dla pliku lub katalogu.

Wyjątki

Parametr rule ma wartość null.

Uwagi

Metoda SetAccessRule dodaje określoną regułę listy kontroli dostępu (ACL) lub zastępuje wszystkie identyczne reguły listy ACL zgodne z FileSystemRights wartością parametru rule . Jeśli na przykład rule parametr określa Read wartość, a SetAccessRule metoda znajdzie identyczną regułę listy ACL określającą Read wartość, identyczna reguła zostanie zastąpiona. SetAccessRule Jeśli metoda znajdzie identyczną regułę listy ACL określającą Write wartość, identyczna reguła nie zostanie zastąpiona.

Aby utrwały nowe lub zmienione informacje listy ACL do pliku, użyj SetAccessControl metody lub SetAccessControl . Aby utrwały nowe lub zmienione informacje listy ACL do katalogu, użyj SetAccessControl metody lub SetAccessControl .

Aby pobrać informacje listy ACL z pliku, użyj GetAccessControl metody lub GetAccessControl . Aby pobrać informacje listy ACL z katalogu, użyj GetAccessControl metody lub GetAccessControl .

Dotyczy