feat: admin group edit / assign / unassign

This commit is contained in:
NGPixel
2018-05-12 16:13:04 -04:00
parent ba6b4bc4dd
commit dc09d00875
17 changed files with 697 additions and 300 deletions

View File

@@ -2,12 +2,6 @@
# ENUMS
enum UserRole {
guest
user
admin
}
enum FileType {
binary
image
@@ -134,19 +128,6 @@ type Translation {
value: String!
}
# A User
type User implements Base {
id: Int!
createdAt: Date
updatedAt: Date
email: String!
provider: String!
providerId: String
name: String
role: UserRole!
groups: [Group]
}
type OperationResult {
succeeded: Boolean!
message: String
@@ -164,7 +145,6 @@ type Query {
settings(key: String): [Setting]
tags(key: String): [Tag]
translations(locale: String!, namespace: String!): [Translation]
users(id: Int, email: String, provider: String, providerId: String, role: UserRole): [User]
}
# Mutations (Create, Update, Delete)
@@ -202,15 +182,6 @@ type Mutation {
name: String!
): Tag
createUser(
email: String!
name: String
passwordRaw: String
provider: String!
providerId: String
role: UserRole!
): User
deleteComment(
id: Int!
): OperationResult
@@ -231,10 +202,6 @@ type Mutation {
id: Int!
): OperationResult
deleteUser(
id: Int!
): OperationResult
modifyComment(
id: Int!
content: String!
@@ -246,15 +213,6 @@ type Mutation {
subtitle: String
): Document
modifyUser(
id: Int!
email: String
name: String
provider: String
providerId: String
role: UserRole
): User
modifyRight(
id: Int!
path: String
@@ -297,20 +255,11 @@ type Mutation {
rightId: Int!
): OperationResult
resetUserPassword(
id: Int!
): OperationResult
setConfigEntry(
key: String!
value: String!
): OperationResult
setUserPassword(
id: Int!
passwordRaw: String!
): OperationResult
uploadFile(
category: FileType!
filename: String!

View File

@@ -37,7 +37,7 @@ type GroupMutation {
update(
id: Int!
name: String!
): GroupResponse
): DefaultResponse
delete(
id: Int!

View File

@@ -0,0 +1,101 @@
# ===============================================
# USERS
# ===============================================
extend type Query {
users: UserQuery
}
extend type Mutation {
users: UserMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type UserQuery {
list(
filter: String
orderBy: String
): [UserMinimal]
search(
query: String!
): [UserMinimal]
single(
id: Int!
): User
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type UserMutation {
create(
email: String!
name: String
passwordRaw: String
provider: String!
providerId: String
role: UserRole!
): UserResponse
update(
id: Int!
email: String
name: String
provider: String
providerId: String
role: UserRole
): UserResponse
delete(
id: Int!
): DefaultResponse
resetPassword(
id: Int!
): DefaultResponse
setPassword(
id: Int!
passwordRaw: String!
): DefaultResponse
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
enum UserRole {
guest
user
admin
}
type UserResponse {
responseResult: ResponseStatus!
user: User
}
type UserMinimal {
id: Int!
name: String!
email: String!
provider: String!
}
type User {
id: Int!
name: String!
email: String!
provider: String!
providerId: String
role: UserRole!
createdAt: Date!
updatedAt: Date!
groups: [Group]
}