jacky-htg / inventory

Inventory System
GNU General Public License v3.0
14 stars 11 forks source link

Added endpoint for listing roles with their associated accesses #41

Open AnilXnmDrz opened 5 months ago

AnilXnmDrz commented 5 months ago

API: GET {{url}}/access-roles

Response:


    "status_code": "REBEL-200",
    "status_message": "OK",
    "data": {
        "status_code": "REBEL-200",
        "status_message": "OK",
        "data": [
            {
                "id": 2,
                "role_id": 2,
                "role_name": "Customer Services",
                "access": [
                    {
                        "access_id": 6,
                        "access_name": "users"
                    },
                    {
                        "access_id": 12,
                        "access_name": "roles"
                    },
                    {
                        "access_id": 30,
                        "access_name": "products"
                    }
                ]
            },
            {
                "id": 1,
                "role_id": 1,
                "role_name": "superadmin",
                "access": [
                    {
                        "access_id": 1,
                        "access_name": "root"
                    }
                ]
            }
        ]
    }
}