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
507055ea
Commit
507055ea
authored
6 years ago
by
Olivér FACKLAM
Browse files
Options
Downloads
Patches
Plain Diff
changement authorization.ts
parent
f693c664
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
notes/hist_rights.md
+1
-1
1 addition, 1 deletion
notes/hist_rights.md
src/graphql/models/tools.ts
+10
-4
10 additions, 4 deletions
src/graphql/models/tools.ts
src/graphql/typeDefs/actions.graphql
+1
-1
1 addition, 1 deletion
src/graphql/typeDefs/actions.graphql
with
12 additions
and
6 deletions
notes/hist_rights.md
+
1
−
1
View file @
507055ea
...
...
@@ -45,7 +45,7 @@ Détaillons ici les conditions exactes pour avoir un niveau de droit donné.
#### Pour les méta-groupes
-
Un user est membre d'un méta-groupe G s'il est membre (hérité) d'un groupe simple dans G.
-
Un user est speaker d'un méta-groupe G s'il est
admin strict
d'un groupe simple dans G.
-
Un user est speaker d'un méta-groupe G s'il est
speaker
d'un groupe simple dans G.
-
Un user est admin d'un méta-groupe G s'il est admin (hérité) d'un groupe simple dans G.
-
Un user est viewer d'un méta-groupe G s'il est viewer d'un groupe simple dans G.
...
...
This diff is collapsed.
Click to expand it.
src/graphql/models/tools.ts
+
10
−
4
View file @
507055ea
...
...
@@ -70,7 +70,10 @@ export class Tools {
*/
static
async
memberOfSimple
(
data
:
userData
):
Promise
<
GroupSet
>
{
//Do a DFS from data.members to find all parents
return
Tools
.
DFS
(
data
.
members
,
'
parent
'
);
//return Tools.DFS(data.members, 'parent');
//No need to do DFS
return
new
GroupSet
(
data
.
members
);
}
/**
...
...
@@ -95,7 +98,10 @@ export class Tools {
*/
static
async
adminOfSimple
(
data
:
userData
):
Promise
<
GroupSet
>
{
//Do a DFS from data.admins to find all children
return
Tools
.
DFS
(
data
.
admins
,
'
child
'
);
//return Tools.DFS(data.admins, 'child');
//No need to do DFS
return
new
GroupSet
(
data
.
admins
);
}
/**
...
...
@@ -135,8 +141,8 @@ export class Tools {
* @async
*/
static
async
speakerOf
(
data
:
userData
):
Promise
<
GroupCollection
>
{
let
s
peaker
=
await
Tools
.
speakerOfSimple
(
data
);
return
{
simpleGroups
:
s
peaker
,
metaGroups
:
await
Tools
.
metaGroupsOfGroups
(
new
GroupSet
(
data
.
admins
)
)
};
let
s
imple
=
await
Tools
.
speakerOfSimple
(
data
);
return
{
simpleGroups
:
s
imple
,
metaGroups
:
await
Tools
.
metaGroupsOfGroups
(
simple
)
};
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/graphql/typeDefs/actions.graphql
+
1
−
1
View file @
507055ea
...
...
@@ -85,7 +85,7 @@ type Mutation {
==
Pour
les
mé
ta
-
groupes
==
-
Un
user
est
membre
d
'
un
mé
ta
-
groupe
G
s
'
il
est
membre
(
hérité
)
d
'
un
groupe
simple
dans
G
.
-
Un
user
est
speaker
d
'
un
mé
ta
-
groupe
G
s
'
il
est
admin
strict
d
'
un
groupe
simple
dans
G
.
-
Un
user
est
speaker
d
'
un
mé
ta
-
groupe
G
s
'
il
est
speaker
d
'
un
groupe
simple
dans
G
.
-
Un
user
est
admin
d
'
un
mé
ta
-
groupe
G
s
'
il
est
admin
(
hérité
)
d
'
un
groupe
simple
dans
G
.
-
Un
user
est
viewer
d
'
un
mé
ta
-
groupe
G
s
'
il
est
viewer
d
'
un
groupe
simple
dans
G
.
...
...
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