Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class PhabricatorCalendarEventHostPolicyRule extends PhabricatorPolicyRule ..

Decoded Output download

<?php

final class PhabricatorCalendarEventHostPolicyRule
  extends PhabricatorPolicyRule {

  public function getObjectPolicyKey() {
    return 'calendar.event.host';
  }

  public function getObjectPolicyName() {
    return pht('Event Host');
  }

  public function getPolicyExplanation() {
    return pht('The host of this event can take this action.');
  }

  public function getRuleDescription() {
    return pht('event host');
  }

  public function canApplyToObject(PhabricatorPolicyInterface $object) {
    return ($object instanceof PhabricatorCalendarEvent);
  }

  public function applyRule(
    PhabricatorUser $viewer,
    $value,
    PhabricatorPolicyInterface $object) {

    $viewer_phid = $viewer->getPHID();
    if (!$viewer_phid) {
      return false;
    }

    return ($object->getHostPHID() == $viewer_phid);
  }

  public function getValueControlType() {
    return self::CONTROL_TYPE_NONE;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorCalendarEventHostPolicyRule
  extends PhabricatorPolicyRule {

  public function getObjectPolicyKey() {
    return 'calendar.event.host';
  }

  public function getObjectPolicyName() {
    return pht('Event Host');
  }

  public function getPolicyExplanation() {
    return pht('The host of this event can take this action.');
  }

  public function getRuleDescription() {
    return pht('event host');
  }

  public function canApplyToObject(PhabricatorPolicyInterface $object) {
    return ($object instanceof PhabricatorCalendarEvent);
  }

  public function applyRule(
    PhabricatorUser $viewer,
    $value,
    PhabricatorPolicyInterface $object) {

    $viewer_phid = $viewer->getPHID();
    if (!$viewer_phid) {
      return false;
    }

    return ($object->getHostPHID() == $viewer_phid);
  }

  public function getValueControlType() {
    return self::CONTROL_TYPE_NONE;
  }

}

Function Calls

None

Variables

None

Stats

MD5 d6bac7ad628648215b099af8cd7f3f70
Eval Count 0
Decode Time 96 ms