Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
7e8d4a21
Verified
Commit
7e8d4a21
authored
Jan 30, 2018
by
Kaspar Vollenweider
👻
Browse files
fix problem with group_offer policy
parent
1bba203a
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/policies/application_policy.rb
View file @
7e8d4a21
...
...
@@ -32,8 +32,11 @@ class ApplicationPolicy
end
def
department_manager_offer?
department_manager?
&&
(
user
.
department
.
include?
(
record
.
department
)
||
user
.
group_offers
.
include?
(
record
))
department_manager?
&&
department_manager_offer_related?
end
def
department_manager_offer_related?
user
.
department
.
include?
(
record
.
department
)
||
user
.
group_offers
.
include?
(
record
)
end
def
superadmin_or_department_manager_offer?
...
...
app/views/group_offers/index.html.slim
View file @
7e8d4a21
...
...
@@ -96,7 +96,7 @@ table.table.table-striped
-
if
offer
.
period_end
.
blank?
=
link_to
"
#{
offer
.
active?
?
t
(
'.deactivate'
)
:
t
(
'.activate'
)
}
"
,
change_active_state_group_offer_path
(
offer
),
method: :put
,
remote: :true
=
link_to_if
(
policy
(
GroupO
ffer
).
initiate_termination?
,
'Beenden'
,
initiate_termination_group_offer_path
(
offer
))
{
''
}
=
link_to_if
(
policy
(
o
ffer
).
initiate_termination?
,
'Beenden'
,
initiate_termination_group_offer_path
(
offer
))
{
''
}
nav
.navbar.section-navigation
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment