Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume WANG
gdd-sigma-poc
Commits
06163cda
Commit
06163cda
authored
7 years ago
by
Quentin CHEVALIER
Browse files
Options
Downloads
Patches
Plain Diff
Chgt noms fonctions
parent
18a294a7
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
src/graphql/schema.js
+4
-4
4 additions, 4 deletions
src/graphql/schema.js
src/ldap/ldap_data.js
+74
-49
74 additions, 49 deletions
src/ldap/ldap_data.js
with
79 additions
and
54 deletions
README.md
+
1
−
1
View file @
06163cda
[

](https://gitlab.binets.fr/br/sigma-backend/commits/master)
# Introduction
#
# Introduction
Ce dépôt contient le _backend_ de Sigma, le successeur de Frankiz, un site étudiant permettant de gérer les groupes et les étudiants du plateau de Saclay.
...
...
This diff is collapsed.
Click to expand it.
src/graphql/schema.js
+
4
−
4
View file @
06163cda
...
...
@@ -3,7 +3,7 @@
* @author akka vodol
*/
import
knex
from
'
../../db/knex_router
'
;
import
{
rens
,
idTOL
,
listGroups
,
listMemb
e
rs
,
listAdmins
}
from
'
../ldap/ldap_data
'
;
import
{
rens
eignerSurUtilisateur
,
repliquerTOLdesIds
,
list
er
Group
e
s
,
list
er
Membr
e
s
,
list
er
Admin
istrateur
s
}
from
'
../ldap/ldap_data
'
;
import
{
makeExecutableSchema
}
from
'
graphql-tools
'
;
import
{
request
}
from
'
https
'
;
import
{
assertBinaryExpression
}
from
'
babel-types
'
;
...
...
@@ -74,7 +74,7 @@ const typeDefs = `
* @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
=
(
user
,
groupUID
)
=>
{
return
listAdmins
(
user
,
groupUID
).
then
(
adminList
=>
{
return
list
er
Admin
istrateur
s
(
user
,
groupUID
).
then
(
adminList
=>
{
if
(
typeof
adminList
==
"
undefined
"
)
return
undefined
;
else
...
...
@@ -109,7 +109,7 @@ const hasAdminRights = (user, groupuid) => {
*/
const
getAllVisibleGroups
=
(
user
)
=>
{
return
listGroups
(
user
,
user
.
uid
).
then
(
group_ids
=>
{
return
list
er
Group
e
s
(
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
'
]));
...
...
@@ -222,7 +222,7 @@ const resolvers = {
console
.
log
(
"
Logged in as:
"
,
context
.
user
);
const
result
=
rens
(
context
.
user
,
args
.
uid
).
then
(
res
=>
{
const
result
=
rens
eignerSurUtilisateur
(
context
.
user
,
args
.
uid
).
then
(
res
=>
{
const
output
=
res
.
map
(
entry
=>
refactorer
(
entry
));
return
output
;
});
...
...
This diff is collapsed.
Click to expand it.
src/ldap/ldap_data.js
+
74
−
49
View file @
06163cda
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment