Overview
The @abpjs/identity package provides complete user and role management components for ABP Framework applications.
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
| Component | Description |
|---|---|
UsersComponent | Complete user management table with modals |
RolesComponent | Complete role management table with modals |
Hooks
| Hook | Description |
|---|---|
useUsers | User management with CRUD and pagination |
useRoles | Role management with CRUD |
useIdentity | Combined hook for users and roles |
Services
| Service | Description |
|---|---|
IdentityService | Direct API interaction for identity operations |
IdentityStateService | State 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
| Permission | Description |
|---|---|
AbpIdentity.Users | View users |
AbpIdentity.Users.Create | Create users |
AbpIdentity.Users.Update | Update users |
AbpIdentity.Users.Delete | Delete users |
AbpIdentity.Users.ManagePermissions | Manage user permissions |
AbpIdentity.Roles | View roles |
AbpIdentity.Roles.Create | Create roles |
AbpIdentity.Roles.Update | Update roles |
AbpIdentity.Roles.Delete | Delete roles |
AbpIdentity.Roles.ManagePermissions | Manage role permissions |
NPM Package
View on npm: @abpjs/identity