add a drawer for the user details

This commit is contained in:
riley
2017-05-04 13:58:43 -06:00
parent d255ea84b1
commit 57b0b5ec67
12 changed files with 96 additions and 32 deletions
+9 -2
View File
@@ -10,6 +10,13 @@ const User = {
}
},
created_at({roles, created_at}, _, {user}) {
if (user && user.hasRoles('ADMIN')) {
return created_at;
}
return null;
},
comments({id}, _, {loaders: {Comments}, user}) {
// If the user is not an admin, only return comment list for the owner of
@@ -20,10 +27,10 @@ const User = {
return null;
},
profiles({id, profiles}, _, {user}) {
profiles({profiles}, _, {user}) {
// if the user is not an admin, do not return the profiles
if (user && (user.hasRoles('ADMIN') || user.id === id)) {
if (user && user.hasRoles('ADMIN')) {
return profiles;
}
+3
View File
@@ -38,6 +38,9 @@ type User {
# Username of a user.
username: String!
# creation date of user
created_at: String!
# Action summaries against the user.
action_summaries: [ActionSummary]!