-
Notifications
You must be signed in to change notification settings - Fork 0
Permissions Management API
M♢NTΛSIM edited this page Aug 17, 2024
·
1 revision
-
POST
/permissions/
- Summary: Creates a new permission record. This endpoint is accessible only to users with admin permissions.
- Security: Bearer Authentication
-
Request Body:
-
Content-Type:
application/json
-
Schema:
{ "type": "object", "properties": { "name": { "type": "string", "description": "The name of the permission." }, "description": { "type": "string", "description": "A brief description of the permission." } } }
-
Content-Type:
-
Responses:
- 201 Created: Permission created successfully.
- 400 Bad Request: Invalid input data.
-
Tags:
- Permissions Management
-
GET
/permissions/
- Summary: Fetches a list of permissions, optionally filtered by various criteria.
- Security: Bearer Authentication
-
Responses:
-
200 OK: A list of permissions.
-
Content-Type:
application/json
-
Schema:
{ "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } } } }
-
Content-Type:
-
200 OK: A list of permissions.
-
Tags:
- Permissions Management
-
DELETE
/permissions/
- Summary: Deletes a list of permissions based on provided identifiers.
- Security: Bearer Authentication
-
Request Body:
-
Content-Type:
application/json
-
Schema:
{ "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" }, "description": "Array of permission IDs to delete." } } }
-
Content-Type:
-
Responses:
- 200 OK: Permissions deleted successfully.
- 400 Bad Request: Invalid request format.
-
Tags:
- Permissions Management
-
POST
/permissions/default
- Summary: Generates and assigns default permissions.
- Security: Bearer Authentication
-
Responses:
- 201 Created: Default permissions created successfully.
-
Tags:
- Permissions Management
-
GET
/permissions/{id}
- Summary: Fetches details of a specific permission by its ID.
- Security: Bearer Authentication
-
Parameters:
-
Path Parameter:
-
Name:
id
- Description: The ID of the permission.
-
Schema:
{ "type": "string" }
-
Name:
-
Path Parameter:
-
Responses:
- 200 OK: Permission details retrieved successfully.
- 404 Not Found: Permission not found.
-
Tags:
- Permissions Management
-
PUT
/permissions/{id}
- Summary: Modifies details of a specific permission using its ID.
- Security: Bearer Authentication
-
Request Body:
-
Content-Type:
application/json
-
Schema:
{ "type": "object", "properties": { "name": { "type": "string", "description": "Updated name of the permission." }, "description": { "type": "string", "description": "Updated description of the permission." } } }
-
Content-Type:
-
Responses:
- 200 OK: Permission updated successfully.
- 404 Not Found: Permission not found.
-
Tags:
- Permissions Management
-
DELETE
/permissions/{id}
- Summary: Removes a specific permission using its ID.
- Security: Bearer Authentication
-
Parameters:
-
Path Parameter:
-
Name:
id
- Description: The ID of the permission to delete.
-
Schema:
{ "type": "string" }
-
Name:
-
Path Parameter:
-
Responses:
- 200 OK: Permission deleted successfully.
- 404 Not Found: Permission not found.
-
Tags:
- Permissions Management
-
All Other Methods on
/permissions/
,/permissions/default
, and/permissions/{id}
- Summary: Handles unsupported methods for the respective endpoints.
-
Responses:
- 405 Method Not Allowed: Method not supported.
-
Tags:
- Permissions Management