![]() |
VOOZH | about |
dotnet add package XperienceCommunity.MemberRoles --version 2.6.0
NuGet\Install-Package XperienceCommunity.MemberRoles -Version 2.6.0
<PackageReference Include="XperienceCommunity.MemberRoles" Version="2.6.0" />
<PackageVersion Include="XperienceCommunity.MemberRoles" Version="2.6.0" />Directory.Packages.props
<PackageReference Include="XperienceCommunity.MemberRoles" />Project file
paket add XperienceCommunity.MemberRoles --version 2.6.0
#r "nuget: XperienceCommunity.MemberRoles, 2.6.0"
#:package XperienceCommunity.MemberRoles@2.6.0
#addin nuget:?package=XperienceCommunity.MemberRoles&version=2.6.0Install as a Cake Addin
#tool nuget:?package=XperienceCommunity.MemberRoles&version=2.6.0Install as a Cake Tool
This is a community created package to allow Member Roles and permissions in Xperience by Kentico (until this logic is baked into the product).
Roles can be created, assigned to Members, and Content Items can be secured with Authentication and Member Role Permissions applied to themselves or inherited from a parent Content Folders and Web Page Items.
This project is using Xperience Version v30.9.0.
| Xperience Version | Library Version |
|---|---|
| >= 31.0.* | 2.6.0 |
| 30.9.0-30.12.3 | 2.5.0 |
| 30.6.* | 2.4.0 |
| 30.0.0-30.5.4 | 2.0.0-2.3.2 |
| 29.7.* | 1.0.0 |
Add the package to your application using the .NET CLI
dotnet add package XperienceCommunity.MemberRoles.Admin
Additionally, you can elect to install only the required packages on specific projects if you have separation of concerns:
XperienceCommunity.MemberRoles.Core : No Xperience Dependencies XperienceCommunity.MemberRoles: Kentico.Xperience.WebApp Dependent (No Admin) XperienceCommunity.MemberRoles.Admin : Kentico.Xperience.Admin (Admin Items)
In your startup, when you call the .AddIdentity<TUser,TRole> ...
TagApplicationUserRole as the TRole (still use Kentico's Applicationuser as TUser).AddMemberRolesStores<TUser, TRole>() off your IdentityBuilderThis will hook up all the interfaces (including IUserRoleStore, and IRoleStore) and run the installation logic on application run. Below is the basic Kentico Authentication Hookup with Member Roles.
public static void AddStandardKenticoAuthentication(WebApplicationBuilder builder)
{
// Adds Basic Kentico Authentication, needed for user context and some tools
builder.Services.AddAuthentication();
// XperienceCommunity.MemberRoles, make sure Role is TagApplicationUserRole or an inherited member here
builder.Services.AddIdentity<ApplicationUser, TagApplicationUserRole>(options => {
// Ensures that disabled member accounts cannot sign in
options.SignIn.RequireConfirmedAccount = true;
// Ensures unique emails for registered accounts
options.User.RequireUniqueEmail = true;
})
.AddUserStore<ApplicationUserStore<ApplicationUser>>()
.AddMemberRolesStores<ApplicationUser, TagApplicationUserRole>() // XperienceCommunity.MemberRoles
.AddUserManager<UserManager<ApplicationUser>>()
.AddSignInManager<SignInManager<ApplicationUser>>();
// Adds authorization support to the app
builder.Services.AddAuthorization();
}
Please see the for Xperience Users or the for instructions.
While this package includes the ability to create and assign Roles to Users, to define Content Item Permissions, and Interfaces that can be used to determine access and filter out items, it does not have the systems to automatically apply Web Page Security rules for a page request.
I will be working on the updated version of the XperienceCommunity.Authorization package (probably wil be renamed XperienceCommunity.DevTools.Authorization) shortly that will then leverage these to introduce Controller Based and Tree Routing Based request filtering, tying into Page Permissions.
Kentico released the "Is Secure" on Content Items (Properties → Membership (Web Channel) or just Properties (Content Hub)) which was intended to mark items as needing Member Authentication to accesses. I was not able to leverage this field, so for all intents and purposes, this field is ignored by Member Roles in it's filtering. The new UIs have their own "Is Secure" field which you should use.
Please feel free to create a pull request if you find any bugs. If you are on the Xperience Community Slack, that's the best place to hit me up so I get eyes on it.
Distributed under the MIT License. See for more information.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on XperienceCommunity.MemberRoles:
| Package | Downloads |
|---|---|
|
XperienceCommunity.Baseline.Core.XperienceModels.Xperience
The Baseline a set of Core Systems, Tools, and Structure to ensure a superior Kentico Website that's easy to migrate, for Kentico Xperience 13 and eventually Xperience by Kentico |
|
|
XperienceCommunity.Baseline.Core.Library.Xperience
The Baseline a set of Core Systems, Tools, and Structure to ensure a superior Kentico Website that's easy to migrate, for Kentico Xperience 13 and eventually Xperience by Kentico |
|
|
XperienceCommunity.MemberRoles.Admin
Temporary Community Implementation of Member Roles for Xperience by Kentico (Until Kentico implements this). This package inherits all the other packages, and additionally contains the Admin UI elements. |
|
|
XperienceCommunity.DevTools.Authorization.MemberRoles
Allows you to place authorization rules on Controller Actions and PageBuilder requests that can authorize based on Users (Members), Roles, Authenticated, or custom logic. This version leverages the XperienceCommunity.MemberRoles system for Role and Page Permission Assignment. |
|
|
Baseline.Core
Baseline v3 Core - Foundation services for Xperience by Kentico including SEO, caching, structured data, and content retrieval. |
This package is not used by any popular GitHub repositories.
Updated to Xperience 31.0.0