/** * @param \DNEnvironment $environment * @param \Member|null $member * @return bool */ public static function can_bypass_approval(\DNEnvironment $environment, \Member $member = null) { if ($member === null) { $member = \Member::currentUser(); } // special case for non-Production environments: users who can deploy are able to bypass approval. if ($environment->Usage !== \DNEnvironment::PRODUCTION && $environment->canDeploy($member)) { return true; } return $environment->Project()->allowed(self::ALLOW_APPROVAL_BYPASS, $member); }