mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
(bug) unable to show member children for admin
This commit is contained in:
parent
ff84babed4
commit
8b1cce3a9d
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Next release
|
## Next release
|
||||||
|
|
||||||
|
- Fix a bug: unable to show member children for admin
|
||||||
|
|
||||||
## v6.3.23 2024 May 20
|
## v6.3.23 2024 May 20
|
||||||
|
|
||||||
- Fix a bug: unable to update availability slot end time for training
|
- Fix a bug: unable to update availability slot end time for training
|
||||||
|
@ -7,7 +7,6 @@ class API::ChildrenController < API::APIController
|
|||||||
before_action :set_child, only: %i[show update destroy validate]
|
before_action :set_child, only: %i[show update destroy validate]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize Child
|
|
||||||
user_id = current_user.id
|
user_id = current_user.id
|
||||||
user_id = params[:user_id] if current_user.privileged? && params[:user_id]
|
user_id = params[:user_id] if current_user.privileged? && params[:user_id]
|
||||||
@children = Child.where(user_id: user_id).where('birthday >= ?', 18.years.ago).includes(:supporting_document_files).order(:created_at)
|
@children = Child.where(user_id: user_id).where('birthday >= ?', 18.years.ago).includes(:supporting_document_files).order(:created_at)
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
# Check the access policies for API::ChildrenController
|
# Check the access policies for API::ChildrenController
|
||||||
class ChildPolicy < ApplicationPolicy
|
class ChildPolicy < ApplicationPolicy
|
||||||
def index?
|
|
||||||
!user.organization?
|
|
||||||
end
|
|
||||||
|
|
||||||
def create?
|
def create?
|
||||||
!user.organization? && user.id == record.user_id
|
!user.organization? && user.id == record.user_id
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user