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.

84 lines
1.8 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. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  33. delete(
  34. id: Int!
  35. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  36. assignUser(
  37. groupId: Int!
  38. userId: Int!
  39. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  40. unassignUser(
  41. groupId: Int!
  42. userId: Int!
  43. ): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
  44. }
  45. # -----------------------------------------------
  46. # TYPES
  47. # -----------------------------------------------
  48. type GroupResponse {
  49. responseResult: ResponseStatus!
  50. group: Group
  51. }
  52. type GroupMinimal {
  53. id: Int!
  54. name: String!
  55. isSystem: Boolean!
  56. userCount: Int
  57. createdAt: Date!
  58. updatedAt: Date!
  59. }
  60. type Group {
  61. id: Int!
  62. name: String!
  63. isSystem: Boolean!
  64. permissions: [String]!
  65. pageRules: [Right]
  66. users: [UserMinimal]
  67. createdAt: Date!
  68. updatedAt: Date!
  69. }