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
a44c5d81
Commit
a44c5d81
authored
7 years ago
by
Wilson JALLET
Browse files
Options
Downloads
Patches
Plain Diff
Post.authors work
parent
ce343f79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/graphql/connectors/connectors.js
+1
-0
1 addition, 0 deletions
src/graphql/connectors/connectors.js
src/graphql/connectors/selectors.js
+2
-2
2 additions, 2 deletions
src/graphql/connectors/selectors.js
src/graphql/resolvers.js
+13
-11
13 additions, 11 deletions
src/graphql/resolvers.js
with
16 additions
and
13 deletions
src/graphql/connectors/connectors.js
+
1
−
0
View file @
a44c5d81
...
...
@@ -582,6 +582,7 @@ export async function getMetaGroupsFromCallbacks (user, selection){
* @rights user
*/
export
async
function
getGroupsFromCallbacks
(
user
,
cbList
){
console
.
log
(
cbList
);
let
all_simple_groups
=
await
getSimpleGroupsFromCallbacks
(
user
,
cbList
);
let
all_meta_groups
=
await
getMetaGroupsFromCallbacks
(
user
,
cbList
);
return
all_simple_groups
.
concat
(
all_meta_groups
);
...
...
This diff is collapsed.
Click to expand it.
src/graphql/connectors/selectors.js
+
2
−
2
View file @
a44c5d81
...
...
@@ -15,11 +15,11 @@
* @rights user
*/
export
async
function
visibleGroups
(
user
){
let
group_ids
=
await
user
.
ldap_access
.
list
er
Group
e
s
(
user
.
uid
);
let
group_ids
=
await
user
.
ldap_access
.
listGroups
(
user
.
uid
);
return
function
(
global_query_builder
){
if
(
typeof
group_ids
==
"
undefined
"
)
throw
"
invalid user
"
;
var
membered_groups
=
qb
=>
qb
.
select
(
'
simple_groups.
uid
'
).
from
(
'
simple_groups
'
).
whereIn
(
'
uid
'
,
group_ids
.
concat
([
'
kes
'
]));
var
membered_groups
=
qb
=>
qb
.
select
(
'
uid
'
).
from
(
'
simple_groups
'
).
whereIn
(
'
uid
'
,
group_ids
.
concat
([
'
kes
'
]));
var
directly_visible_simple_groups
=
qb
=>
qb
.
with
(
'
membered_groups
'
,
membered_groups
)
.
select
(
'
simple_groups.uid
'
).
from
(
'
simple_groups
'
).
distinct
()
.
innerJoin
(
'
membered_groups
'
,
...
...
This diff is collapsed.
Click to expand it.
src/graphql/resolvers.js
+
13
−
11
View file @
a44c5d81
...
...
@@ -205,12 +205,15 @@ export const resolvers = {
__resolveType
:
function
(
obj
)
{
return
obj
.
type
;
}
,
}
},
Post
:
{
authors
:
(
obj
,
args
,
context
)
=>
{
console
.
log
(
obj
);
return
knex
.
select
().
from
(
'
groups
'
).
whereIn
(
'
uid
'
,
obj
.
authors
);
}
},
Announcement
:
{
...
...
@@ -246,21 +249,20 @@ export const resolvers = {
// @rights viewer(obj.uid)
Group
:
{
__resolveType
:
(
obj
)
=>
{
console
.
log
(
obj
);
__resolveType
:
async
(
obj
)
=>
{
let
isSimple
=
knex
.
select
().
from
(
"
groups
"
).
where
(
"
uid
"
,
obj
.
uid
)
.
then
(
res
=>
{
console
.
log
(
res
);
return
res
;
});
return
undefined
;
switch
(
obj
.
type
)
{
case
"
simple
"
:
return
"
SimpleGroup
"
;
case
"
meta
"
:
return
"
MetaGroup
"
;
}
}
},
// @rights viewer(obj.uid)
SimpleGroup
:
{
members
:
(
obj
,
args
,
context
)
=>
{
return
connectors
.
utilisateur
.
listMembers
(
context
.
user
,
obj
.
uid
);
}
...
...
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