rank_id; } public function getUserJobs() { return \Auth::user()->job_id; } /** * Get ACL rules list for user * * @return array */ public function getRules(): array { $rules = \DB::table('acl_rules') ->where('user_id', $this->getUserID()) ->get(['disk', 'path', 'access']) ->map(function ($item) { return get_object_vars($item); }) ->all(); $rank_rules = \DB::table('acl_rules') ->where('rank_id', $this->getUserRank()) ->get(['disk', 'path', 'access']) ->map(function ($item) { return get_object_vars($item); }) ->all(); $job_rules = \DB::table('acl_rules') ->where('job_id', $this->getUserJobs()) ->get(['disk', 'path', 'access']) ->map(function ($item) { return get_object_vars($item); }) ->all(); $all_rules = \DB::table('acl_rules') ->where('user_id', '=','*') ->get(['disk', 'path', 'access']) ->map(function ($item) { return get_object_vars($item); }) ->all(); $rules = array_merge($rules,$rank_rules,$job_rules,$all_rules); return $rules; } }