private static void OnAuthorizationFailed()
 {
     if (AuthorizationFailed != null)
     {
         AuthorizationFailed.Invoke(null, new EventArgs());
     }
 }
 private void OnAuthorizationFailed()
 {
     if (AuthorizationFailed != null)
     {
         AuthorizationFailed.Invoke(this, new EventArgs());
     }
 }
Example #3
0
        /// <summary>Checks that the current user is authorized to access the current item.</summary>
        public virtual void AuthorizeRequest(IPrincipal user, ContentItem page, Permission requiredPermission)
        {
            if (page != null)
            {
                if (page != null && !security.IsAuthorized(user, page, requiredPermission))
                {
                    CancellableItemEventArgs args = new CancellableItemEventArgs(page);
                    if (AuthorizationFailed != null)
                    {
                        AuthorizationFailed.Invoke(this, args);
                    }

                    if (!args.Cancel)
                    {
                        throw new PermissionDeniedException(page, user);
                    }
                }
            }
        }
Example #4
0
        /// <summary>Checks that the current user is authorized to access the current item.</summary>
        public virtual void AuthorizeRequest(IPrincipal user, ContentItem page, Permission requiredPermission)
        {
            if (page != null)
            {
                if (page != null && !security.IsAuthorized(user, page, requiredPermission))
                {
                    CancellableItemEventArgs args = new CancellableItemEventArgs(page);
                    if (AuthorizationFailed != null)
                    {
                        AuthorizationFailed.Invoke(this, args);
                    }

                    if (args.Cancel)
                    {
                        logger.Info("AuthorizeRequest: Default permission denied handling cancelled by event handler.");
                    }
                    else
                    {
                        logger.InfoFormat("AuthorizeRequest: Executing default permission denied action with http code {0}.", permissionDeniedHttpCode);
                        throw new PermissionDeniedException(permissionDeniedHttpCode, permissionDeniedHttpCode == 401 ? "Unauthorized" : "Not Found", page, user);
                    }
                }
            }
        }
Example #5
0
 private void OnAuthorizationFailed(ResponseError e) => AuthorizationFailed?.Invoke(this, e);
Example #6
0
 void RaiseAuthorizationFailed(string error, string description = "")
 {
     AuthorizationFailed?.Invoke(this, new VKAuthorizationError(error, description));
 }
Example #7
0
 protected virtual void OnAuthorizationFailed(ResponseError e) => AuthorizationFailed?.Invoke(this, e);
Example #8
0
 /// <summary>
 /// Raises the <see cref="E:AuthorizationFailed" /> event.
 /// </summary>
 /// <param name="e">The <see cref="SMSEventArgs"/> instance containing the event data.</param>
 protected virtual void OnAuthorizationFailed(SMSEventArgs e)
 {
     AuthorizationFailed?.Invoke(this, e);
 }