group.graphql 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # ===============================================
  2. # GROUPS
  3. # ===============================================
  4. extend type Query {
  5. groups(
  6. filter: String
  7. orderBy: String
  8. ): [Group]
  9. groupById(
  10. id: UUID!
  11. ): Group
  12. }
  13. extend type Mutation {
  14. createGroup(
  15. name: String!
  16. ): GroupResponse
  17. updateGroup(
  18. id: UUID!
  19. name: String!
  20. redirectOnLogin: String!
  21. permissions: [String]!
  22. rules: [GroupRuleInput]!
  23. ): DefaultResponse
  24. deleteGroup(
  25. id: UUID!
  26. ): DefaultResponse
  27. assignUserToGroup(
  28. groupId: UUID!
  29. userId: UUID!
  30. ): DefaultResponse
  31. unassignUserFromGroup(
  32. groupId: UUID!
  33. userId: UUID!
  34. ): DefaultResponse
  35. }
  36. # -----------------------------------------------
  37. # TYPES
  38. # -----------------------------------------------
  39. type GroupResponse {
  40. operation: Operation
  41. group: Group
  42. }
  43. type Group {
  44. id: UUID
  45. name: String
  46. isSystem: Boolean
  47. redirectOnLogin: String
  48. redirectOnFirstLogin: String
  49. redirectOnLogout: String
  50. permissions: [String]
  51. rules: [GroupRule]
  52. users(
  53. page: Int
  54. pageSize: Int
  55. orderBy: UserOrderBy
  56. orderByDirection: OrderByDirection
  57. # Filter by name / email
  58. filter: String
  59. ): [UserMinimal]
  60. userCount: Int
  61. createdAt: Date
  62. updatedAt: Date
  63. }
  64. type GroupRule {
  65. id: UUID
  66. name: String
  67. mode: GroupRuleMode
  68. match: GroupRuleMatch
  69. roles: [String]
  70. path: String
  71. locales: [String]
  72. sites: [UUID]
  73. }
  74. input GroupRuleInput {
  75. id: UUID!
  76. name: String!
  77. mode: GroupRuleMode!
  78. match: GroupRuleMatch!
  79. roles: [String]!
  80. path: String!
  81. locales: [String]!
  82. sites: [UUID]
  83. }
  84. enum GroupRuleMode {
  85. ALLOW
  86. DENY
  87. FORCEALLOW
  88. }
  89. enum GroupRuleMatch {
  90. START
  91. EXACT
  92. END
  93. REGEX
  94. TAG
  95. TAGALL
  96. }