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
c06991b0
Commit
c06991b0
authored
7 years ago
by
Anatole ROMON
Browse files
Options
Downloads
Patches
Plain Diff
pour pouvoir pull
parent
1970987b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graphql/schema.js
+14
-6
14 additions, 6 deletions
src/graphql/schema.js
with
14 additions
and
6 deletions
src/graphql/schema.js
+
14
−
6
View file @
c06991b0
...
@@ -35,7 +35,7 @@ const typeDefs = `
...
@@ -35,7 +35,7 @@ const typeDefs = `
type AdminMutation {
type AdminMutation {
test
: Boolean
isAdmin
: Boolean
createSubgroup(
createSubgroup(
uid: ID = null,
uid: ID = null,
...
@@ -159,6 +159,10 @@ const getAvailableGroupUID = (initialUID) => {
...
@@ -159,6 +159,10 @@ const getAvailableGroupUID = (initialUID) => {
});
});
};
};
const
createGroup
=
(
user
,
args
)
=>
{
}
/**
/**
* @summary Créé un groupe si les arguments sont tous valides et l'utilisateur est authorisé
* @summary Créé un groupe si les arguments sont tous valides et l'utilisateur est authorisé
* @desc Les arguments doivent être valides, sauf pour uid. Une clé uid valide sera générée dans tous les cas.
* @desc Les arguments doivent être valides, sauf pour uid. Une clé uid valide sera générée dans tous les cas.
...
@@ -237,9 +241,9 @@ const resolvers = {
...
@@ -237,9 +241,9 @@ const resolvers = {
asAdmin
:
(
obj
,
args
,
context
)
=>
{
asAdmin
:
(
obj
,
args
,
context
)
=>
{
return
hasAdminRights
(
context
.
user
,
args
.
groupid
).
then
(
res
=>
{
return
hasAdminRights
(
context
.
user
,
args
.
groupid
).
then
(
res
=>
{
if
(
res
)
if
(
res
)
return
{
hasAdminRights
:
true
};
return
{};
else
else
return
{
hasA
dmin
R
ights
:
false
}
;
throw
"
You do not have a
dmin
r
ights
over this group
"
;
});
});
},
},
createGroup
:
(
obj
,
args
,
context
)
=>
{
createGroup
:
(
obj
,
args
,
context
)
=>
{
...
@@ -248,9 +252,13 @@ const resolvers = {
...
@@ -248,9 +252,13 @@ const resolvers = {
},
},
AdminMutation
:
{
AdminMutation
:
{
test
:
(
obj
,
args
,
context
)
=>
{
console
.
log
(
obj
);
isAdmin
:
(
obj
,
args
,
context
)
=>
{
console
.
log
(
typeof
obj
);
return
true
;
},
createSubgroup
:
(
obj
,
args
,
context
)
=>
{
console
.
log
(
"
oh shit!
"
);
return
null
;
return
null
;
}
}
...
...
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