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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
485b9355
Commit
485b9355
authored
2 years ago
by
David Siegfried
Browse files
Options
Downloads
Patches
Plain Diff
hide request-buttons for user without permissions, closes #1270
Closes #1270 Merge request
studip/studip!877
parent
ef8f85c9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/resources/room.php
+13
-17
13 additions, 17 deletions
app/controllers/resources/room.php
app/views/resources/room/index.php
+4
-5
4 additions, 5 deletions
app/views/resources/room/index.php
with
17 additions
and
22 deletions
app/controllers/resources/room.php
+
13
−
17
View file @
485b9355
...
...
@@ -33,6 +33,7 @@ class Resources_RoomController extends AuthenticatedController
public
function
index_action
(
$room_id
=
null
)
{
$this
->
user
=
User
::
findCurrent
();
$this
->
room
=
Room
::
find
(
$room_id
);
if
(
!
$this
->
room
)
{
...
...
@@ -54,20 +55,12 @@ class Resources_RoomController extends AuthenticatedController
Navigation
::
activateItem
(
'/room_management/overview/index'
);
}
$user
=
User
::
findCurrent
();
$current_user_is_resource_admin
=
$this
->
room
->
userHasPermission
(
$user
,
'admin'
);
$current_user_is_resource_tutor
=
$this
->
room
->
userHasPermission
(
$user
,
'tutor'
);
$this
->
current_user_is_resource_autor
=
$this
->
room
->
userHasPermission
(
$user
,
'autor'
);
$current_user_is_resource_user
=
$this
->
room
->
userHasPermission
(
$user
);
$this
->
current_user_is_resource_admin
=
$this
->
room
->
userHasPermission
(
$this
->
user
,
'admin'
);
$current_user_is_resource_tutor
=
$this
->
room
->
userHasPermission
(
$this
->
user
,
'tutor'
);
$this
->
current_user_is_resource_autor
=
$this
->
room
->
userHasPermission
(
$this
->
user
,
'autor'
);
$this
->
current_user_has_request_rights
=
$this
->
room
->
userHasRequestRights
(
$this
->
user
);
$current_user_is_resource_user
=
$this
->
room
->
userHasPermission
(
$this
->
user
);
$this
->
booking_plan_is_visible
=
$this
->
room
->
bookingPlanVisibleForUser
(
$this
->
user
);
$sidebar
=
Sidebar
::
get
();
$actions
=
new
ActionsWidget
();
...
...
@@ -92,7 +85,7 @@ class Resources_RoomController extends AuthenticatedController
'target'
=>
'_blank'
]
);
}
elseif
(
$this
->
room
->
booking
P
lan
V
isible
ForUser
(
$user
)
)
{
}
elseif
(
$this
->
booking
_p
lan
_is_v
isible
)
{
$actions_available
=
true
;
$actions
->
addLink
(
_
(
'Belegungsplan'
),
...
...
@@ -111,7 +104,7 @@ class Resources_RoomController extends AuthenticatedController
]
);
}
if
(
$current_user_is_resource_admin
)
{
if
(
$
this
->
current_user_is_resource_admin
)
{
$actions_available
=
true
;
$actions
->
addLink
(
_
(
'Raum bearbeiten'
),
...
...
@@ -142,7 +135,10 @@ class Resources_RoomController extends AuthenticatedController
);
}
}
if
(
!
$this
->
current_user_is_resource_autor
&&
$this
->
room
->
requestable
)
{
if
(
!
$this
->
current_user_is_resource_autor
&&
$this
->
room
->
requestable
&&
$this
->
current_user_has_request_rights
)
{
$actions_available
=
true
;
$actions
->
addLink
(
_
(
'Raum anfragen'
),
...
...
This diff is collapsed.
Click to expand it.
app/views/resources/room/index.php
+
4
−
5
View file @
485b9355
...
...
@@ -69,7 +69,7 @@
<?
endif
?>
<footer
data-dialog-button
>
<?
if
(
$
room
->
userHasPermission
(
User
::
findCurrent
(),
'
autor
'
)
)
:
?>
<?
if
(
$
current_user_is_resource_
autor
)
:
?>
<?=
\Studip\LinkButton
::
create
(
_
(
'Wochenbelegung'
),
$room
->
getActionURL
(
'booking_plan'
)
...
...
@@ -78,7 +78,7 @@
_
(
'Semesterbelegung'
),
$room
->
getActionURL
(
'semester_plan'
)
)
?>
<?
elseif
(
$
room
->
booking
P
lan
V
isible
ForUser
(
User
::
findCurrent
())
)
:
?>
<?
elseif
(
$booking
_p
lan
_is_v
isible
)
:
?>
<?=
\Studip\LinkButton
::
create
(
_
(
'Belegungsplan'
),
$room
->
getActionURL
(
'booking_plan'
)
...
...
@@ -97,7 +97,7 @@
)
)
?>
<?
endif
?>
<?
if
(
$
room
->
userHasPermission
(
User
::
findCurrent
(),
'
admin
'
)
)
:
?>
<?
if
(
$
current_user_is_resource_
admin
)
:
?>
<?=
\Studip\LinkButton
::
createEdit
(
_
(
'Bearbeiten'
),
$room
->
getActionURL
(
'edit'
),
...
...
@@ -106,11 +106,10 @@
]
)
?>
<?
endif
?>
<?
if
(
!
$current_user_is_resource_autor
&&
$room
->
requestable
)
:
?>
<?
if
(
!
$current_user_is_resource_autor
&&
$room
->
requestable
&&
$current_user_has_request_rights
)
:
?>
<?=
\Studip\LinkButton
::
create
(
_
(
'Raum anfragen'
),
$room
->
getActionURL
(
'request'
),
[
'data-dialog'
=>
'size=auto'
])
?>
<?
endif
?>
</footer>
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