2018-03-19 03:12:56 +00:00
|
|
|
# ===============================================
|
|
|
|
# GROUPS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
groups: GroupQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
groups: GroupMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupQuery {
|
|
|
|
list(
|
|
|
|
filter: String
|
|
|
|
orderBy: String
|
2018-10-14 21:38:39 +00:00
|
|
|
): [GroupMinimal] @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-26 05:11:49 +00:00
|
|
|
|
|
|
|
single(
|
2018-03-28 04:02:32 +00:00
|
|
|
id: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): Group @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-19 03:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupMutation {
|
|
|
|
create(
|
|
|
|
name: String!
|
2018-10-14 21:38:39 +00:00
|
|
|
): GroupResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-19 03:12:56 +00:00
|
|
|
|
|
|
|
update(
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
2018-12-30 02:30:51 +00:00
|
|
|
permissions: [String]!
|
|
|
|
pageRules: [PageRuleInput]!
|
2018-10-14 21:38:39 +00:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-19 03:12:56 +00:00
|
|
|
|
|
|
|
delete(
|
|
|
|
id: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-19 03:12:56 +00:00
|
|
|
|
|
|
|
assignUser(
|
|
|
|
groupId: Int!
|
|
|
|
userId: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-19 03:12:56 +00:00
|
|
|
|
|
|
|
unassignUser(
|
|
|
|
groupId: Int!
|
|
|
|
userId: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-19 03:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupResponse {
|
2018-03-25 02:35:47 +00:00
|
|
|
responseResult: ResponseStatus!
|
2018-03-19 03:12:56 +00:00
|
|
|
group: Group
|
|
|
|
}
|
|
|
|
|
2018-03-26 05:11:49 +00:00
|
|
|
type GroupMinimal {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
2018-10-14 21:38:39 +00:00
|
|
|
isSystem: Boolean!
|
2018-03-26 05:11:49 +00:00
|
|
|
userCount: Int
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|
|
|
|
|
2018-03-19 03:12:56 +00:00
|
|
|
type Group {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
2018-10-14 21:38:39 +00:00
|
|
|
isSystem: Boolean!
|
|
|
|
permissions: [String]!
|
2018-12-30 02:30:51 +00:00
|
|
|
pageRules: [PageRule]
|
2018-10-14 21:38:39 +00:00
|
|
|
users: [UserMinimal]
|
2018-03-19 03:12:56 +00:00
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|
2018-12-30 02:30:51 +00:00
|
|
|
|
|
|
|
type PageRule {
|
|
|
|
id: String!
|
|
|
|
deny: Boolean!
|
|
|
|
match: PageRuleMatch!
|
2019-01-12 23:33:30 +00:00
|
|
|
roles: [String]!
|
2018-12-30 02:30:51 +00:00
|
|
|
path: String!
|
|
|
|
locales: [String]!
|
|
|
|
}
|
|
|
|
|
|
|
|
input PageRuleInput {
|
|
|
|
id: String!
|
|
|
|
deny: Boolean!
|
|
|
|
match: PageRuleMatch!
|
2019-01-12 23:33:30 +00:00
|
|
|
roles: [String]!
|
2018-12-30 02:30:51 +00:00
|
|
|
path: String!
|
|
|
|
locales: [String]!
|
|
|
|
}
|
|
|
|
|
|
|
|
enum PageRuleMatch {
|
|
|
|
START
|
|
|
|
EXACT
|
|
|
|
END
|
|
|
|
REGEX
|
2020-01-31 21:57:35 +00:00
|
|
|
TAG
|
2018-12-30 02:30:51 +00:00
|
|
|
}
|