Allow for Coach role on Team

@param User $user Currently authenticated User
@param string $ability Ability key to authenticate (unused)
@param Member $member Member affected
@return boolean
351311
public function before(User $user, $ability, Member $member)
    {
        if ($this->fallThroughBefore($ability)) {
            return null;
        }
        return $this->allowForRoleOnTeam($user, 'Coach', $member->team_id, null);
    }
710276
protected function resolveAuthCallback($user, $ability, array $arguments)
    {
        if ($this->firstArgumentCorrespondsToPolicy($arguments)) {
            return $this->resolvePolicyCallback($user, $ability, $arguments);
        } elseif (isset($this->abilities[$ability])) {
            return $this->abilities[$ability];
        } else {
            return function () {
                return false;
            };
        }
    }
516010
protected function canIf(string $action, ?Authorizable $user = null): bool
    {
        return ! \is_null($user)
                    ? $this->acl->canIfAs($user, $action)
                    : $this->acl->canIf($action);
    }
865670
public function can($ability, $arguments = array())
    {
        $gate = App::make('Nova\Auth\Access\GateInterface')->forUser($this);

        return $gate->check($ability, $arguments);
    }
561481
public function can($capability, $args = null)
	{
		if (!$this->user())
		{
			return false;
		}

		$userCan = false;

		if (is_array($capability))
		{
			foreach ($capability as $cap)
			{
				// if only one capability is accepted
				if (current_user_can($cap, $args) === true)
				{
					$userCan = true;
					break;
				}
			}
		}
		else
		{
			$userCan = current_user_can($capability, $args);
		}

		return $userCan;
	}
257450
public function view(User $user, MemberCategory $member)
    {
        return $this->allowOnTeam($user, $member->team_id);
    }
309543
public static function hasAccessInCapabilities(string $capability, string $userId): bool
    {
        $userCaps = static::fetchUserCapabilities($userId);
        if (in_array($capability, $userCaps)) {
            return true;
        }

        return false;
    }
298284
protected function callBeforeCallbacks($user, $ability, array $arguments)
    {
        $arguments = array_merge([$user, $ability], $arguments);

        foreach ($this->beforeCallbacks as $before) {
            if (! is_null($result = call_user_func_array($before, $arguments))) {
                return $result;
            }
        }
    }
334002
protected function CanEdit(User $user)
    {
        return self::Guard()->Allow(BackendAction::Edit(), $user)&&
            self::Guard()->Allow(BackendAction::UseIt(), new UserForm());
    }
262183
public function findByAbilitiesAndStatus(User $user, array $abilities, $status)
    {
        return $this->createQueryBuilder('ap')
            ->select('ap')
            ->where('ap.user = :user')
            ->andWhere('ap.ability IN (:abilities)')
            ->andWhere('ap.status = :status')
            ->orderBy('ap.id')
            ->setParameters([
                ':user' => $user,
                ':abilities' => $abilities,
                ':status' => $status,
            ])
            ->getQuery()
            ->getResult();
    }
251963
public function before(User $user, $ability, MemberTag $memberTag)
    {
        if ($this->fallThroughBefore($ability)) {
            return null;
        }
        return $this->allowForRoleOnTeam($user, 'Coach', $memberTag->team_id, null);
    }
123715
protected function callAfterCallbacks(User $user, $ability, array $arguments, $result)
    {
        $arguments = array_merge(array($user, $ability, $result), $arguments);

        foreach ($this->afterCallbacks as $callback) {
            call_user_func_array($callback, $arguments);
        }
    }
1001855
public function userTeamIndexAction(Team $team, User $currentUser)
    {
        $workspace = $team->getWorkspace();
        $this->checkToolAccess($workspace);
        $isTeamMember = $this->isTeamMember($team, $currentUser);
        $isTeamManager = $this->isTeamManager($team, $currentUser);

        if (!$isTeamMember && !$isTeamManager) {

            throw new AccessDeniedException();
        }
        $users = $team->getUsers();
        $params = $this->teamManager->getParametersByWorkspace($workspace);

        return array(
            'workspace' => $workspace,
            'currentUser' => $currentUser,
            'users' => $users,
            'team' => $team,
            'params' => $params,
            'isTeamMember' => $isTeamMember,
            'isTeamManager' => $isTeamManager
        );
    }
511843
public function canIfAs(Authorizable $user, string $action): bool
    {
        $this->setUser($user);

        $permission = $this->canIf($action);

        $this->revokeUser();

        return $permission;
    }
728960
public function view(User $user, Location $location)
    {
        return $this->allowOnTeam($user, $location->team_id);
    }
206785
public function update(User $user, MemberCategory $memberCategory)
    {
        return $this->allowForRoleOnTeam($user, 'Coach', $memberCategory->team_id);
    }
709113
public function manage(User $user, Job $job)
    {
        return $this->allowOnTeam($user, $job->team_id);
    }