rm -rf permission module
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
2026-09-19 02:40:38 +05:00
parent c6b9cb7462
commit 848a07324f
10 changed files with 193 additions and 119 deletions

View File

@@ -4977,14 +4977,14 @@ const docTemplate = `{
}
}
},
"/permission-roles": {
"/permission-roles/bulk": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Creates a permission-role assignment, or updates the existing pair if already assigned",
"description": "Replaces roleId's whole permission set with permissionIds - pairs not listed are removed, missing ones are added, an empty list clears all permissions from the role",
"consumes": [
"application/json"
],
@@ -4994,15 +4994,15 @@ const docTemplate = `{
"tags": [
"permission-roles"
],
"summary": "Assign permission to role",
"summary": "Set a role's permissions",
"parameters": [
{
"description": "Permission-role payload",
"description": "Role + the permission IDs it should have",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/permissionrole.CreatePermissionRoleDTO"
"$ref": "#/definitions/permissionrole.SetRolePermissionsDTO"
}
}
],
@@ -9359,15 +9359,18 @@ const docTemplate = `{
}
}
},
"permissionrole.CreatePermissionRoleDTO": {
"permissionrole.SetRolePermissionsDTO": {
"type": "object",
"required": [
"permissionId",
"permissionIds",
"roleId"
],
"properties": {
"permissionId": {
"type": "integer"
"permissionIds": {
"type": "array",
"items": {
"type": "integer"
}
},
"roleId": {
"type": "integer"

View File

@@ -4971,14 +4971,14 @@
}
}
},
"/permission-roles": {
"/permission-roles/bulk": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Creates a permission-role assignment, or updates the existing pair if already assigned",
"description": "Replaces roleId's whole permission set with permissionIds - pairs not listed are removed, missing ones are added, an empty list clears all permissions from the role",
"consumes": [
"application/json"
],
@@ -4988,15 +4988,15 @@
"tags": [
"permission-roles"
],
"summary": "Assign permission to role",
"summary": "Set a role's permissions",
"parameters": [
{
"description": "Permission-role payload",
"description": "Role + the permission IDs it should have",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/permissionrole.CreatePermissionRoleDTO"
"$ref": "#/definitions/permissionrole.SetRolePermissionsDTO"
}
}
],
@@ -9353,15 +9353,18 @@
}
}
},
"permissionrole.CreatePermissionRoleDTO": {
"permissionrole.SetRolePermissionsDTO": {
"type": "object",
"required": [
"permissionId",
"permissionIds",
"roleId"
],
"properties": {
"permissionId": {
"type": "integer"
"permissionIds": {
"type": "array",
"items": {
"type": "integer"
}
},
"roleId": {
"type": "integer"

View File

@@ -1364,14 +1364,16 @@ definitions:
- module
- name
type: object
permissionrole.CreatePermissionRoleDTO:
permissionrole.SetRolePermissionsDTO:
properties:
permissionId:
type: integer
permissionIds:
items:
type: integer
type: array
roleId:
type: integer
required:
- permissionId
- permissionIds
- roleId
type: object
province.CreateProvinceDTO:
@@ -4941,39 +4943,6 @@ paths:
summary: Update payment settings
tags:
- payment-settings
/permission-roles:
post:
consumes:
- application/json
description: Creates a permission-role assignment, or updates the existing pair
if already assigned
parameters:
- description: Permission-role payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/permissionrole.CreatePermissionRoleDTO'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Assign permission to role
tags:
- permission-roles
/permission-roles/{id}:
delete:
description: Deletes a permission-role assignment
@@ -5007,6 +4976,40 @@ paths:
summary: Remove permission from role
tags:
- permission-roles
/permission-roles/bulk:
post:
consumes:
- application/json
description: Replaces roleId's whole permission set with permissionIds - pairs
not listed are removed, missing ones are added, an empty list clears all permissions
from the role
parameters:
- description: Role + the permission IDs it should have
in: body
name: body
required: true
schema:
$ref: '#/definitions/permissionrole.SetRolePermissionsDTO'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/appresult.AppSuccess'
"400":
description: Bad Request
schema:
$ref: '#/definitions/appresult.AppError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/appresult.AppError'
security:
- BearerAuth: []
summary: Set a role's permissions
tags:
- permission-roles
/permissions:
get:
description: Returns paginated permissions with optional filters