コード例 #1
0
 public function hasAutomaticCapability($capability, PhabricatorUser $viewer)
 {
     if ($viewer->getPHID() == $this->getOwnerPHID()) {
         return true;
     }
     if ($capability == PhabricatorPolicyCapability::CAN_VIEW) {
         foreach ($viewer->getAuthorities() as $authority) {
             if ($authority instanceof PhortuneMerchant) {
                 if ($authority->getPHID() == $this->getMerchantPHID()) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
コード例 #2
0
 public function hasAutomaticCapability($capability, PhabricatorUser $viewer)
 {
     $members = array_fuse($this->getMemberPHIDs());
     if (isset($members[$viewer->getPHID()])) {
         return true;
     }
     // If the viewer is acting on behalf of a merchant, they can see
     // payment accounts.
     if ($capability == PhabricatorPolicyCapability::CAN_VIEW) {
         foreach ($viewer->getAuthorities() as $authority) {
             if ($authority instanceof PhortuneMerchant) {
                 return true;
             }
         }
     }
     return false;
 }