1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(bug) unable to show member children for admin

This commit is contained in:
Du Peng 2024-05-24 15:22:37 +02:00
parent ff84babed4
commit 8b1cce3a9d
3 changed files with 2 additions and 5 deletions

View File

@ -2,6 +2,8 @@
## Next release
- Fix a bug: unable to show member children for admin
## v6.3.23 2024 May 20
- Fix a bug: unable to update availability slot end time for training

View File

@ -7,7 +7,6 @@ class API::ChildrenController < API::APIController
before_action :set_child, only: %i[show update destroy validate]
def index
authorize Child
user_id = current_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)

View File

@ -2,10 +2,6 @@
# Check the access policies for API::ChildrenController
class ChildPolicy < ApplicationPolicy
def index?
!user.organization?
end
def create?
!user.organization? && user.id == record.user_id
end