Skip to main content
Version: 2.9.0

Overview

The @abpjs/identity package provides complete user and role management components for ABP Framework applications.

npm version

Installation​

npm install @abpjs/identity

Required peer dependencies:

npm install @abpjs/core @abpjs/theme-shared @abpjs/permission-management

Features​

  • User Management - Complete CRUD for users with search and pagination
  • Role Management - Complete CRUD for roles
  • Permission Integration - Assign permissions to users and roles
  • Role Assignment - Assign roles to users
  • i18n Support - Full localization support

Main Exports​

Components​

ComponentDescription
UsersComponentComplete user management table with modals
RolesComponentComplete role management table with modals

Hooks​

HookDescription
useUsersUser management with CRUD and pagination
useRolesRole management with CRUD
useIdentityCombined hook for users and roles

Services​

ServiceDescription
IdentityServiceDirect API interaction for identity operations
IdentityStateServiceState management with dispatch methods (v2.0.0)

Quick Example​

import { UsersComponent, RolesComponent } from '@abpjs/identity';

function IdentityManagement() {
return (
<div>
<h1>User Management</h1>
<UsersComponent />

<h1>Role Management</h1>
<RolesComponent />
</div>
);
}

IdentityStateService (v2.0.0)​

The IdentityStateService provides programmatic access to dispatch identity state actions:

import { IdentityStateService } from '@abpjs/identity';

// Fetch roles
IdentityStateService.dispatchGetRoles();

// Create a role
IdentityStateService.dispatchCreateRole({
name: 'Manager',
isDefault: false,
isPublic: true,
});

// Update a role
IdentityStateService.dispatchUpdateRole({
id: 'role-id',
input: { name: 'Senior Manager', isDefault: false, isPublic: true },
});

// Delete a role
IdentityStateService.dispatchDeleteRole('role-id');

// User operations
IdentityStateService.dispatchGetUsers();
IdentityStateService.dispatchCreateUser({ /* user data */ });
IdentityStateService.dispatchUpdateUser({ id: 'user-id', input: { /* user data */ } });
IdentityStateService.dispatchDeleteUser('user-id');

Required Permissions​

PermissionDescription
AbpIdentity.UsersView users
AbpIdentity.Users.CreateCreate users
AbpIdentity.Users.UpdateUpdate users
AbpIdentity.Users.DeleteDelete users
AbpIdentity.Users.ManagePermissionsManage user permissions
AbpIdentity.RolesView roles
AbpIdentity.Roles.CreateCreate roles
AbpIdentity.Roles.UpdateUpdate roles
AbpIdentity.Roles.DeleteDelete roles
AbpIdentity.Roles.ManagePermissionsManage role permissions

NPM Package​

View on npm: @abpjs/identity

Documentation​