web portal es tab view added
This commit is contained in:
parent
c78570eb11
commit
6bf818f1d8
35 changed files with 2592 additions and 116 deletions
|
@ -8,6 +8,8 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization.Enums
|
|||
Empty = 0,
|
||||
None = 1,
|
||||
Read = 2,
|
||||
Write = 4
|
||||
Write = 4,
|
||||
OwaRead = 8,
|
||||
OwaEdit = 16
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Cobalt;
|
||||
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
using WebsitePanel.WebDav.Core.Config;
|
||||
|
@ -54,6 +55,17 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization
|
|||
}
|
||||
}
|
||||
|
||||
var owaEditFolders = GetOwaFoldersWithEditPermission(principal);
|
||||
|
||||
if (owaEditFolders.Contains(rootFolder))
|
||||
{
|
||||
resultPermissions |= WebDavPermissions.OwaEdit;
|
||||
}
|
||||
else
|
||||
{
|
||||
resultPermissions |= WebDavPermissions.OwaRead;
|
||||
}
|
||||
|
||||
return resultPermissions;
|
||||
}
|
||||
|
||||
|
@ -105,5 +117,41 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization
|
|||
|
||||
return groups ?? new ExchangeAccount[0];
|
||||
}
|
||||
|
||||
private IEnumerable<string> GetOwaFoldersWithEditPermission(WspPrincipal principal)
|
||||
{
|
||||
var folders = HttpContext.Current.Session != null ? HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.OwaEditFoldersSessionKey] as IEnumerable<string> : null;
|
||||
|
||||
if (folders != null)
|
||||
{
|
||||
return folders;
|
||||
}
|
||||
|
||||
var accountsIds = new List<int>();
|
||||
|
||||
accountsIds.Add(principal.AccountId);
|
||||
|
||||
var groups = GetUserSecurityGroups(principal);
|
||||
|
||||
accountsIds.AddRange(groups.Select(x=>x.AccountId));
|
||||
|
||||
try
|
||||
{
|
||||
folders = WspContext.Services.EnterpriseStorage.GetUserEnterpriseFolderWithOwaEditPermission(principal.ItemId, accountsIds.ToArray());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//TODO remove try catch when es &portal will be updated
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
|
||||
if (HttpContext.Current.Session != null)
|
||||
{
|
||||
HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.OwaEditFoldersSessionKey] = folders;
|
||||
}
|
||||
|
||||
return folders;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue