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
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Jan-Hendrik Willms
Stud.IP
Commits
df3965cd
Commit
df3965cd
authored
2 years ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fix role loading for nobody, fixes #1209
Closes #1209 Merge request
studip/studip!718
parent
7ae6beef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/plugins/db/RolePersistence.class.php
+10
-13
10 additions, 13 deletions
lib/plugins/db/RolePersistence.class.php
with
10 additions
and
13 deletions
lib/plugins/db/RolePersistence.class.php
+
10
−
13
View file @
df3965cd
...
...
@@ -221,21 +221,18 @@ class RolePersistence
$cache
=
self
::
getUserRolesCache
();
if
(
!
isset
(
$cache
[
$user_id
]))
{
$query
=
"SELECT DISTINCT *
FROM (
SELECT `roleid`, `institut_id`, 1 AS explicit
FROM `roles_user`
WHERE `userid` = :user_id
UNION
SELECT `roleid`, '' AS institut_id, 0 AS explicit
FROM `roles_studipperms`
WHERE `permname` = :perm
) AS tmp"
;
$query
=
"SELECT `roleid`, `institut_id`, 1 AS explicit
FROM `roles_user`
WHERE `userid` = :user_id
UNION ALL
SELECT `roleid`, '' AS institut_id, 0 AS explicit
FROM `roles_studipperms`
WHERE `permname` = :perm"
;
$statement
=
DBManager
::
get
()
->
prepare
(
$query
);
$statement
->
bindValue
(
':user_id'
,
$user_id
);
$statement
->
bindValue
(
':perm'
,
$GLOBALS
[
'perm'
]
->
get_perm
(
$user_id
));
$statement
->
bindValue
(
':perm'
,
is_object
(
$GLOBALS
[
'perm'
])
?
$GLOBALS
[
'perm'
]
->
get_perm
(
$user_id
)
:
'nobody'
);
$statement
->
execute
();
$statement
->
setFetchMode
(
PDO
::
FETCH_ASSOC
);
...
...
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