Skip to main content

Roles & Permissions

Where it lives
JSON Pointer: /roles
JSONPath: $.roles
Parent: Root of the metadata file

Overview

Roles in SolidX provide a way to group permissions and manage access control at a high level. Each role represents a set of permissions that can be assigned to users. Permissions in SOLID are automatically discovered based on controller actions and provide fine-grained control over what users can do within the system.

By Default Admin role is created with all permissions.

Example: Fee Portal Module Roles & Permissions Metadata

Roles & Permissions Schema
{
..., // Other metadata
"roles": [ // Array of role metadata
{
"name": "Institute Admin",
"description": "Admin role for managing institute-related operations",
"permissions": [ // Array of permissions
"InstituteController.create",
"InstituteController.insertMany",
"InstituteController.update",
"InstituteController.partialUpdate"
"InstituteController.findOne",
"InstituteController.findMany",
"InstituteController.delete",
"InstituteController.deleteMany",
"InstituteController.recover",
"InstituteController.recoverMany",
],
}
]
}

Roles & Permissions Metadata Attributes

name (string, required, unique)

Name of the role.

description (string, optional)

A brief description of the role's purpose.

permissions (array of strings, optional)

An array of permission strings associated with the role. Each permission corresponds to a specific action that can be performed within the system, typically in the format controller.method (e.g., InstituteController.update).

Info

Permissions are automatically discovered based on controller methods in the codebase. So for e.g., if you have a controller for managing institutes with methods like create, the permission InstituteController.create will be automatically created.