private static void OnAuthorizationFailed() { if (AuthorizationFailed != null) { AuthorizationFailed.Invoke(null, new EventArgs()); } }
private void OnAuthorizationFailed() { if (AuthorizationFailed != null) { AuthorizationFailed.Invoke(this, new EventArgs()); } }
/// <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); } } } }
/// <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); } } } }
private void OnAuthorizationFailed(ResponseError e) => AuthorizationFailed?.Invoke(this, e);
void RaiseAuthorizationFailed(string error, string description = "") { AuthorizationFailed?.Invoke(this, new VKAuthorizationError(error, description)); }
protected virtual void OnAuthorizationFailed(ResponseError e) => AuthorizationFailed?.Invoke(this, e);
/// <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); }