uni-id-roles.schema.json 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {
  2. "bsonType": "object",
  3. "required": ["role_id", "role_name"],
  4. "permission": {
  5. "read": "'READ_UNI_ID_ROLES' in auth.permission",
  6. "create": "'CREATE_UNI_ID_ROLES' in auth.permission",
  7. "update": "'UPDATE_UNI_ID_ROLES' in auth.permission",
  8. "delete": "'DELETE_UNI_ID_ROLES' in auth.permission"
  9. },
  10. "properties": {
  11. "_id": {
  12. "description": "存储文档 ID,系统自动生成"
  13. },
  14. "comment": {
  15. "title": "备注",
  16. "bsonType": "string",
  17. "description": "备注",
  18. "trim": "both"
  19. },
  20. "create_date": {
  21. "bsonType": "timestamp",
  22. "description": "创建时间",
  23. "forceDefaultValue": {
  24. "$env": "now"
  25. }
  26. },
  27. "permission": {
  28. "title": "权限",
  29. "bsonType": "array",
  30. "foreignKey": "uni-id-permissions.permission_id",
  31. "description": "角色拥有的权限列表",
  32. "enum": {
  33. "collection": "uni-id-permissions",
  34. "field": "permission_name as text, permission_id as value"
  35. }
  36. },
  37. "role_id": {
  38. "title": "唯一ID",
  39. "bsonType": "string",
  40. "description": "角色唯一标识,不可修改,不允许重复",
  41. "trim": "both"
  42. },
  43. "role_name": {
  44. "title": "名称",
  45. "bsonType": "string",
  46. "description": "角色名称",
  47. "trim": "both"
  48. }
  49. }
  50. }