mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-12 23:09:03 +01:00
(feat) members cannot see training deactivated in the list
This commit is contained in:
parent
adeb3acd79
commit
362cdc4fc4
@ -3,6 +3,7 @@
|
||||
## Next release
|
||||
|
||||
- Improvement: default order for the spaces/trainings list is set to descending by created_at
|
||||
- Improvement: members cannot see training deactivated in the list
|
||||
|
||||
## v6.3.35 2024 November 13
|
||||
|
||||
|
@ -14,6 +14,7 @@ class API::TrainingsController < API::APIController
|
||||
|
||||
def show
|
||||
@training = Training.friendly.find(params[:id])
|
||||
authorize @training
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -8,6 +8,10 @@ class TrainingPolicy < ApplicationPolicy
|
||||
end
|
||||
end
|
||||
|
||||
def show?
|
||||
!record.disabled? || user.admin? || user.manager?
|
||||
end
|
||||
|
||||
def create?
|
||||
user.admin?
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user