SolidX
ReferenceMetadata Schema

Roles & Permissions

Metadata schema for defining roles and permissions in SolidX applications.

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.

Mental Model

Roles and permissions in SolidX work as a two-layer access model. Permissions represent the fine-grained actions the platform knows about, while roles are the business-facing bundles you assign to users.

  • Think of permissions as capabilities discovered from the backend.
    • Think of roles as the practical packaging of those capabilities for real users.
    • Use roles to express job function, not just technical access flags. So the intuition is: permissions describe what the system can do, and roles describe who should be allowed to do it.

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).

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.