canDeploy() public method

Allow deploy only to some people.
public canDeploy ( Member | null $member = null ) : boolean
$member Member | null
return boolean
コード例 #1
0
 /**
  * @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);
 }