mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add authorization for toggle_favorite and rename route
This commit is contained in:
parent
2485923319
commit
91629d9b92
5 changed files with 11 additions and 5 deletions
|
|
@ -108,6 +108,10 @@ class Ability
|
|||
event.users.include?(user)
|
||||
end
|
||||
|
||||
can :toggle_favorite, Event do |event|
|
||||
event.scheduled?
|
||||
end
|
||||
|
||||
# can manage the commercials of their own events
|
||||
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: user.events.pluck(:id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue