You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.2 KiB

  1. # ===============================================
  2. # GROUPS
  3. # ===============================================
  4. extend type Query {
  5. groups: GroupQuery
  6. }
  7. extend type Mutation {
  8. groups: GroupMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type GroupQuery {
  14. list(
  15. filter: String
  16. orderBy: String
  17. ): [GroupMinimal] @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  18. single(
  19. id: Int!
  20. ): Group @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  21. }
  22. # -----------------------------------------------
  23. # MUTATIONS
  24. # -----------------------------------------------
  25. type GroupMutation {
  26. create(
  27. name: String!
  28. ): GroupResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  29. update(
  30. id: Int!
  31. name: String!
  32. permissions: [String]!
  33. pageRules: [PageRuleInput]!
  34. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  35. delete(
  36. id: Int!
  37. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  38. assignUser(
  39. groupId: Int!
  40. userId: Int!
  41. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  42. unassignUser(
  43. groupId: Int!
  44. userId: Int!
  45. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  46. }
  47. # -----------------------------------------------
  48. # TYPES
  49. # -----------------------------------------------
  50. type GroupResponse {
  51. responseResult: ResponseStatus!
  52. group: Group
  53. }
  54. type GroupMinimal {
  55. id: Int!
  56. name: String!
  57. isSystem: Boolean!
  58. userCount: Int
  59. createdAt: Date!
  60. updatedAt: Date!
  61. }
  62. type Group {
  63. id: Int!
  64. name: String!
  65. isSystem: Boolean!
  66. permissions: [String]!
  67. pageRules: [PageRule]
  68. users: [UserMinimal]
  69. createdAt: Date!
  70. updatedAt: Date!
  71. }
  72. type PageRule {
  73. id: String!
  74. deny: Boolean!
  75. match: PageRuleMatch!
  76. roles: [String]!
  77. path: String!
  78. locales: [String]!
  79. }
  80. input PageRuleInput {
  81. id: String!
  82. deny: Boolean!
  83. match: PageRuleMatch!
  84. roles: [String]!
  85. path: String!
  86. locales: [String]!
  87. }
  88. enum PageRuleMatch {
  89. START
  90. EXACT
  91. END
  92. REGEX
  93. TAG
  94. }