Files
online-backend/internal/identity/permissionrole/dto.go
GuwandykA 848a07324f
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
rm -rf permission module
2026-09-19 02:40:38 +05:00

25 lines
959 B
Go

package permissionrole
import "time"
type PermissionRoleDTO struct {
Id int64 `json:"id"`
RoleId int64 `json:"roleId"`
RoleName string `json:"roleName"`
PermissionId int64 `json:"permissionId"`
PermissionName string `json:"permissionName"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// SetRolePermissionsDTO replaces a role's whole permission set: after the
// call, the role is assigned exactly PermissionIds - pairs not listed are
// removed, pairs listed but missing are added, and pairs already present
// are left as-is. An empty PermissionIds clears all permissions from the
// role. This is the only way to attach/update a role's permissions - there
// is no single-pair create endpoint.
type SetRolePermissionsDTO struct {
RoleId int64 `json:"roleId" binding:"required"`
PermissionIds []int64 `json:"permissionIds" binding:"required"`
}