Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Churros
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexandre Vanicotte--Hochman
Churros
Commits
0e6f4aaa
Commit
0e6f4aaa
authored
1 year ago
by
Ewen Le Bihan
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of
https://git.inpt.fr/inp-net/churros
parents
677d3f04
a8df4a04
Branches
Branches containing commit
Tags
v0.9.2
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/api/src/objects/users.ts
+9
-9
9 additions, 9 deletions
packages/api/src/objects/users.ts
with
9 additions
and
9 deletions
packages/api/src/objects/users.ts
+
9
−
9
View file @
0e6f4aaa
...
...
@@ -428,11 +428,11 @@ builder.mutationField('updateUser', (t) =>
await
requestEmailChange
(
email
,
targetUser
.
id
);
}
if
(
!
(
user
.
canEditUsers
||
user
.
admin
)
&&
(
changingContributesTo
||
changingGraduationYear
)
)
throw
new
GraphQLError
(
'
Not authorized to change graduation year
or contributions
'
);
if
(
!
(
user
.
canEditUsers
||
user
.
admin
)
&&
changingGraduationYear
)
throw
new
GraphQLError
(
'
Not authorized to change graduation year
'
);
purgeUserSessions
(
uid
);
if
(
changingContributesTo
&&
contributesTo
)
{
if
(
changingContributesTo
&&
contributesTo
&&
(
user
.
canEditUsers
||
user
.
admin
)
)
{
await
prisma
.
contribution
.
deleteMany
({
where
:
{
studentAssociationId
:
{
...
...
@@ -495,9 +495,9 @@ builder.mutationField('updateUserPermissions', (t) =>
canEditUsers
:
t
.
arg
.
boolean
(),
},
authScopes
:
(
_
,
{},
{
user
})
=>
Boolean
(
user
?.
admin
),
async
resolve
(
query
,
_
,
{
uid
,
canEditGroups
,
canEditUsers
})
{
async
resolve
(
query
,
_
,
{
uid
,
canEditGroups
,
canEditUsers
},
{
user
})
{
purgeUserSessions
(
uid
);
const
user
=
await
prisma
.
user
.
update
({
const
user
Updated
=
await
prisma
.
user
.
update
({
...
query
,
where
:
{
uid
},
data
:
{
canEditGroups
,
canEditUsers
},
...
...
@@ -506,15 +506,15 @@ builder.mutationField('updateUserPermissions', (t) =>
data
:
{
area
:
'
permission
'
,
action
:
'
update
'
,
target
:
user
.
id
,
message
:
`Updated user
${
user
.
uid
}
permissions:
${
JSON
.
stringify
({
target
:
user
Updated
.
id
,
message
:
`Updated user
${
user
Updated
.
uid
}
permissions:
${
JSON
.
stringify
({
canEditGroups
,
canEditUsers
,
})}
`
,
user
:
{
connect
:
{
id
:
user
.
id
}
},
user
:
{
connect
:
{
id
:
user
?
.
id
}
},
},
});
return
user
;
return
user
Updated
;
},
})
);
...
...
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