*/ class ProjectPolicy { use HandlesAuthorization; /** * Determine whether the user can view the project. * * @param \App\Entities\Users\User $user * @param \App\Entities\Projects\Project $project * * @return mixed */ public function view(User $user, Project $project) { // User can only view the project if he is the project's agency owner. return true; } /** * Determine whether the user can create projects. * * @param \App\Entities\Users\User $user * @param \App\Entities\Projects\Project $project * * @return mixed */ public function create(User $user, Project $project) { // User can create a project if they owns an agency. return true; } /** * Determine whether the user can update the project. * * @param \App\Entities\Users\User $user * @param \App\Entities\Projects\Project $project * * @return mixed */ public function update(User $user, Project $project) { return $this->view($user, $project); } /** * Determine whether the user can delete the project. * * @param \App\Entities\Users\User $user * @param \App\Entities\Projects\Project $project * * @return mixed */ public function delete(User $user, Project $project) { return $this->view($user, $project); } }