Save Role Permission

Endpoint: POST /settings/role_permission/save


curl -X POST {{base_url}}/settings/role_permission/save \
-H "Content-Type: application/json" \
-d '{
    "role_id": 1,
    "permission_id": 3,
    "is_create": 1,
    "is_update": 0,
    "is_delete": 0,
    "is_view": 1
}'

This command saves or updates a role permission based on the provided role_id and permission_id.

Copy Role Permissions

Endpoint: POST /settings/role_permission/copy


curl -X POST {{base_url}}/settings/role_permission/copy \
-H "Content-Type: application/json" \
-d '{
    "source_role_id": 1,
    "target_role_id": 2
}'

This command copies all permissions from source_role_id to target_role_id. If the target role already has some permissions, they will be updated with the source role's permissions.

List Permissions by Role

Endpoint: POST /settings/role_permission/list


curl -X POST {{base_url}}/settings/role_permission/list \
-H "Content-Type: application/json" \
-d '{
    "role_id": 1
}'

This command lists all permissions associated with the given role_id.

Get Specific Permission Status

Endpoint: POST /settings/role_permission/get


curl -X POST {{base_url}}/settings/role_permission/get \
-H "Content-Type: application/json" \
-d '{
    "role_id": 1,
    "permission_name": "manage_staff",
    "action": "is_create"
}'

This command retrieves the status of a specific permission action (e.g., is_create, is_update) for a role based on the role_id and permission_name.