Skip to main content

List User Access Permissions

Response

accesos
array
Array of access permission objects

Example Request

curl -X GET https://api.example.com/api/accesos \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

[
  {
    "id": 1,
    "nombre": "Dashboard",
    "icono": "dashboard",
    "url": "/dashboard",
    "activo": true
  },
  {
    "id": 2,
    "nombre": "Sales Management",
    "icono": "shopping_cart",
    "url": "/sales",
    "activo": true
  },
  {
    "id": 3,
    "nombre": "Inventory",
    "icono": "inventory",
    "url": "/inventory",
    "activo": true
  }
]

Get Access Permissions by Role

Path Parameters

rolId
long
required
The unique identifier of the role

Response

accesos
array
Array of access permission objects assigned to the specified role

Example Request

curl -X GET https://api.example.com/api/accesos/por-rol/1 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

[
  {
    "id": 1,
    "nombre": "Dashboard",
    "icono": "dashboard",
    "url": "/dashboard",
    "activo": true
  },
  {
    "id": 2,
    "nombre": "Sales Management",
    "icono": "shopping_cart",
    "url": "/sales",
    "activo": true
  },
  {
    "id": 5,
    "nombre": "Reports",
    "icono": "assessment",
    "url": "/reports",
    "activo": true
  }
]

Error Responses

404 Not Found
error
Returned when the specified role ID does not exist
{
  "error": "Role not found"
}

Role-Based Access Control

Access permissions define which menu items, features, and operations are available to users based on their assigned role:

ADMIN

Full system access including user management, configuration, and all business operations

USER

Standard access to sales, purchases, customers, and basic reports

ALMACENERO

Limited access focused on inventory management, receiving, and stock control
Access permissions are managed through the many-to-many relationship between roles and accesos in the database. Each role can have multiple access permissions, and each access permission can be assigned to multiple roles.

Build docs developers (and LLMs) love