示例#1
0
        public sealed override bool IsAuthorized(Dev2.Common.Interfaces.Enums.AuthorizationContext context, Guid resourceId)
        {
            bool authorized;

            VerifyArgument.IsNotNull("resourceId", resourceId);

            var user = Common.Utilities.OrginalExecutingUser ?? ClaimsPrincipal.Current;

            authorized = IsAuthorized(user, context, resourceId);

            if (!authorized)
            {
                if (ResultsCache.Instance.ContainsPendingRequestForUser(user.Identity.Name))
                {
                    authorized = true;
                }
            }

            if (!authorized)
            {
                _perfCounter?.Increment();
            }
            return(authorized);
        }
示例#2
0
 public override bool IsAuthorized(Dev2.Common.Interfaces.Enums.AuthorizationContext context, IWarewolfResource resource)
 {
     return(IsAuthorized(context, resource?.ResourceID ?? Guid.Empty));
 }