From d86ea2302e4bc66abe35f797ff1527e75d3ba931 Mon Sep 17 00:00:00 2001 From: anatole <anatole.romon@polytechnique.edu> Date: Thu, 1 Mar 2018 19:35:28 +0100 Subject: [PATCH] =?UTF-8?q?=C3=87a=20marche=20pour=20de=20vrai=20maintenan?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphql/schema.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphql/schema.js b/src/graphql/schema.js index ca3ad80..7d30504 100644 --- a/src/graphql/schema.js +++ b/src/graphql/schema.js @@ -55,7 +55,7 @@ const typeDefs = ` */ const getAllVisibleGroups = (user) => { - return listGroups(user.uid, user).then(group_ids => { + return listGroups(user, user.uid).then(group_ids => { if(typeof group_ids == "undefined") throw "invalid user"; var membered_groups = qb => qb.select().from('groups').whereIn('uid', group_ids.concat(['kes'])); @@ -92,8 +92,8 @@ const getGroupIfVisible = (user, uid) => { * @arg {String} uid - L'uid du groupe dont on veut les administrateurs. * @return {Promise} Retour de requête knex. Promise qui renvera une liste de tous les utilisateurs ayant droit d'admin sur le groupe */ -const getUsersWithAdminRights = (uid, user) => { - return listAdmins(uid, user); +const getUsersWithAdminRights = (user, uid) => { + return listAdmins(user, uid); }; /** @@ -116,7 +116,7 @@ const getAvailableGroupUID = (initialUID) => { const createGroupIfLegal = (user, args) => { if(typeof args.parentuid != 'string') throw "Illegal argument : parentuid must be a string"; - return getUsersWithAdminRights(args.parentuid, user).then( admin_list => { + return getUsersWithAdminRights(user, args.parentuid).then( admin_list => { if(typeof admin_list == undefined) throw "invalid argument : no group with id " + args.parentuid; admin_list = admin_list.concat(['anatole.romon']); // pour les besoins des tests, anatole romon a tout les droits -- GitLab