Exemple #1
0
        // This method must be thread-safe since it is called by the thread-safe OnCacheAuthorization() method.
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            // call base method
            var result = base.AuthorizeCore(httpContext);

            // if base return true, check additional logic base on Permissions
            if (result)
            {
                return(AuthorizeService.HasPermission((int)Permission) ||
                       (Permissions != null && AuthorizeService.HasPermission(Permissions.Select(x => (int)x).ToArray())));
            }
            return(false);
        }
Exemple #2
0
 public static bool Has(Permission p)
 {
     return(AuthorizeService.HasPermission((int)p));
 }