/** * Determine if the given user has appropriate privileges to add or deny a user from a project * Checks if the user making the request is a admin for the project and the user being added or denied is actually requesting access to the project * * @param User $user * @param Project $project * @param $userID * @return bool */ public function authToAddDeny(User $user, Project $project, $userID) { return $project->isProjectAdmin($user->id) && $project->isMembershipPending($userID); }