diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs index de3626fd..893f11ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs @@ -294,13 +294,10 @@ namespace WebsitePanel.WebDav.Core.Managers foreach (var folder in WSP.Services.EnterpriseStorage.GetEnterpriseFolders(WspContext.User.ItemId)) { - var permissions = WSP.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(WspContext.User.ItemId, folder.Name); - - foreach (var permission in permissions) + foreach (var rule in folder.Rules) { - if ((!permission.IsGroup - && (permission.DisplayName == user.UserName || permission.DisplayName == user.DisplayName)) - || (permission.IsGroup && userGroups.Any(x => x.DisplayName == permission.DisplayName))) + if ((rule.Users.Any(x=> string.Compare(x, user.AccountName, StringComparison.InvariantCultureIgnoreCase) == 0)) + || (userGroups.Any(x => rule.Roles.Any(r => string.Compare(r, x.AccountName, StringComparison.InvariantCultureIgnoreCase) == 0)))) { rootFolders.Add(folder); break; diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs index 972589f3..921eb47f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs @@ -40,6 +40,7 @@ namespace WebsitePanel.WebDav.Core.Security.Authentication principal.ItemId = exchangeAccount.ItemId; principal.OrganizationId = organization.OrganizationId; principal.DisplayName = exchangeAccount.DisplayName; + principal.AccountName = exchangeAccount.AccountName; principal.EncryptedPassword = _cryptography.Encrypt(password); if (HttpContext.Current != null) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/Principals/WspPrincipal.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/Principals/WspPrincipal.cs index e70bb304..fa8f5d6f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/Principals/WspPrincipal.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/Principals/WspPrincipal.cs @@ -14,6 +14,7 @@ namespace WebsitePanel.WebDav.Core.Security.Authentication.Principals public string Login { get; set; } public string DisplayName { get; set; } + public string AccountName { get; set; } public string UserName {