FileSystemShare: Renamed event from OnAccessRequest to AccessRequested

This commit is contained in:
Tal Aloni 2017-06-22 17:55:15 +03:00
parent fb7d6d4bc8
commit b5db0ac4b8
2 changed files with 3 additions and 3 deletions

View file

@ -37,7 +37,7 @@ namespace SMBLibrary.Server
private string m_name;
private INTFileStore m_fileSystem;
public event EventHandler<AccessRequestArgs> OnAccessRequest;
public event EventHandler<AccessRequestArgs> AccessRequested;
public FileSystemShare(string shareName, INTFileStore fileSystem)
{
@ -64,7 +64,7 @@ namespace SMBLibrary.Server
public bool HasAccess(SecurityContext securityContext, string path, FileAccess requestedAccess)
{
// To be thread-safe we must capture the delegate reference first
EventHandler<AccessRequestArgs> handler = OnAccessRequest;
EventHandler<AccessRequestArgs> handler = AccessRequested;
if (handler != null)
{
AccessRequestArgs args = new AccessRequestArgs(securityContext.UserName, path, requestedAccess, securityContext.MachineName, securityContext.ClientEndPoint);

View file

@ -168,7 +168,7 @@ namespace SMBServer
XmlNode writeAccessNode = shareNode.SelectSingleNode("WriteAccess");
List<string> writeAccess = ReadAccessList(writeAccessNode);
FileSystemShare share = new FileSystemShare(shareName, new DirectoryFileSystem(sharePath));
share.OnAccessRequest += delegate(object sender, AccessRequestArgs args)
share.AccessRequested += delegate(object sender, AccessRequestArgs args)
{
bool hasReadAccess = Contains(readAccess, "Users") || Contains(readAccess, args.UserName);
bool hasWriteAccess = Contains(writeAccess, "Users") || Contains(writeAccess, args.UserName);