Authorization.Kentico.MVC.DynamicRouting 12.29.0

Authorization attribute that integrates with Kentico user permissions, including module permissions and page ACL permissions, leveraging the DynamicRouting.Kentico.MVC library for retreiving the page.

Install-Package Authorization.Kentico.MVC.DynamicRouting -Version 12.29.0
dotnet add package Authorization.Kentico.MVC.DynamicRouting --version 12.29.0
<PackageReference Include="Authorization.Kentico.MVC.DynamicRouting" Version="12.29.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Authorization.Kentico.MVC.DynamicRouting --version 12.29.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Kentico Authorization Attribute

Kentico Authorization Attribute for Kentico MVC, provides a [KenticoAuthorize] Attribute that you can add to your ActionResult methods that can allows for permissions on:

  1. User Authenticated
  2. User Names
  3. User Roles
  4. Page ACL Permissions (May require custom handling, see Events section below)
  5. Resource/Module Permissions

It also allows for a custom Unauthorized Redirect path in case you need to specify a specific location to send unauthorized users.

Installation

  1. Install the Authorization.Kentico.MVC NuGet Package to your MVC Site
  2. Overwrite any Events if you need (expecially the GetPage)
  3. Add [KenticoAuthorize()] attributes to your ActionResult methods.

Usage

  1. Add the [KenticoAuthorize()] Attribute to your ActionResult and pass in any properties you wish to configure.

Events

The Authorization Module has 4 events you can hook into in order to customize it's behavior.

AuthorizeEvents.GetPage

This allows you to modify the retrieval of the current page. By default, it will try to find the page based on the relative path with a match on the NodeAliasPath.

AuthorizeEvents.GetCulture

This allows you to modify the retrieval of the current culture. This is used in the GetPage logic to get the proper TreeNode. By default, It will use the PreviewCulture (if in preview), LocalizationContext.CurrentCulture, and lastly the System.Globalization.CultureInfo.CurrentCulture.Name.

AuthorizeEvents.GetUser

This allows you to modify the retrieval of the current user. By default it will use the HttpContext.User.Identity to get the UserName of the current user. Public is the default user if none found or the found user is disabled.

AuthorizeEvents.Authorizing

This allows you to modify the Authorizing logic itself. By default it will perform all the proper checks on User, Role, Module Permissions, Page ACL, and user allowed cultures. If you do overwrite, you must set SkipDefaultValidation to true in the AuthorizingEventArgs.

Compatability

Can be used on any Kentico 12 SP site (hotfix 29 or above).

Kentico Authorization Attribute

Kentico Authorization Attribute for Kentico MVC, provides a [KenticoAuthorize] Attribute that you can add to your ActionResult methods that can allows for permissions on:

  1. User Authenticated
  2. User Names
  3. User Roles
  4. Page ACL Permissions (May require custom handling, see Events section below)
  5. Resource/Module Permissions

It also allows for a custom Unauthorized Redirect path in case you need to specify a specific location to send unauthorized users.

Installation

  1. Install the Authorization.Kentico.MVC NuGet Package to your MVC Site
  2. Overwrite any Events if you need (expecially the GetPage)
  3. Add [KenticoAuthorize()] attributes to your ActionResult methods.

Usage

  1. Add the [KenticoAuthorize()] Attribute to your ActionResult and pass in any properties you wish to configure.

Events

The Authorization Module has 4 events you can hook into in order to customize it's behavior.

AuthorizeEvents.GetPage

This allows you to modify the retrieval of the current page. By default, it will try to find the page based on the relative path with a match on the NodeAliasPath.

AuthorizeEvents.GetCulture

This allows you to modify the retrieval of the current culture. This is used in the GetPage logic to get the proper TreeNode. By default, It will use the PreviewCulture (if in preview), LocalizationContext.CurrentCulture, and lastly the System.Globalization.CultureInfo.CurrentCulture.Name.

AuthorizeEvents.GetUser

This allows you to modify the retrieval of the current user. By default it will use the HttpContext.User.Identity to get the UserName of the current user. Public is the default user if none found or the found user is disabled.

AuthorizeEvents.Authorizing

This allows you to modify the Authorizing logic itself. By default it will perform all the proper checks on User, Role, Module Permissions, Page ACL, and user allowed cultures. If you do overwrite, you must set SkipDefaultValidation to true in the AuthorizingEventArgs.

Compatability

Can be used on any Kentico 12 SP site (hotfix 29 or above).

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
12.29.0 145 12/17/2019