Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Stud.IP
Stud.IP
Merge requests
!2019
prevent temporary permissions to be deleted when managing them for one user, re
#2158
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
prevent temporary permissions to be deleted when managing them for one user, re
#2158
biest-02158
into
main
Overview
0
Commits
1
Pipelines
3
Changes
1
Merged
Moritz Strohm
requested to merge
biest-02158
into
main
1 year ago
Overview
0
Commits
1
Pipelines
3
Changes
1
Expand
See
#2158 (closed)
0
0
Merge request reports
Viewing commit
9f3d57de
Show latest version
1 file
+
25
−
23
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
9f3d57de
prevent temporary permissions to be deleted when managing them for one user
· 9f3d57de
Moritz Strohm
authored
1 year ago
app/controllers/resources/resource.php
+
25
−
23
Options
@@ -1125,30 +1125,32 @@ class Resources_ResourceController extends AuthenticatedController
}
}
//Now we must remove all permissions where the resource_id is given
//and where the user_id is not in the $user_ids array which has been
//filled above.
if
(
$user_ids
)
{
$deleted_permissions
=
ResourceTemporaryPermission
::
deleteBySql
(
'resource_id = :resource_id
AND
user_id NOT IN ( :user_ids )'
,
[
'resource_id'
=>
$this
->
resource_id
,
'user_ids'
=>
$user_ids
]
);
}
else
{
//In case no user_ids are collected above all permissions
//for the resource have to be deleted:
$deleted_permissions
=
ResourceTemporaryPermission
::
deleteBySQL
(
'resource_id = :resource_id'
,
[
'resource_id'
=>
$this
->
resource_id
,
]
);
$deleted_permissions
=
0
;
if
(
!
$this
->
single_user_mode
)
{
//Now we must remove all permissions where the resource_id is given
//and where the user_id is not in the $user_ids array which has been
//filled above.
if
(
$user_ids
)
{
$deleted_permissions
=
ResourceTemporaryPermission
::
deleteBySql
(
'resource_id = :resource_id
AND
user_id NOT IN ( :user_ids )'
,
[
'resource_id'
=>
$this
->
resource_id
,
'user_ids'
=>
$user_ids
]
);
}
else
{
//In case no user_ids are collected above all permissions
//for the resource have to be deleted:
$deleted_permissions
=
ResourceTemporaryPermission
::
deleteBySQL
(
'resource_id = :resource_id'
,
[
'resource_id'
=>
$this
->
resource_id
,
]
);
}
}
if
(
count
(
$errors
))
{
PageLayout
::
postError
(
_
(
'Die folgenden Fehler traten auf beim Speichern der Berechtigungen:'
),
Loading