Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/conpherence/policyrule/ConpherenceThreadMembersPolicyRule.php
12256 views
1
<?php
2
3
final class ConpherenceThreadMembersPolicyRule
4
extends PhabricatorPolicyRule {
5
6
public function getObjectPolicyKey() {
7
return 'conpherence.members';
8
}
9
10
public function getObjectPolicyName() {
11
return pht('Room Participants');
12
}
13
14
public function getPolicyExplanation() {
15
return pht('Participants in this room can take this action.');
16
}
17
18
public function getRuleDescription() {
19
return pht('room participants');
20
}
21
22
public function getObjectPolicyIcon() {
23
return 'fa-comments';
24
}
25
26
public function canApplyToObject(PhabricatorPolicyInterface $object) {
27
return ($object instanceof ConpherenceThread);
28
}
29
30
public function applyRule(
31
PhabricatorUser $viewer,
32
$value,
33
PhabricatorPolicyInterface $object) {
34
$viewer_phid = $viewer->getPHID();
35
if (!$viewer_phid) {
36
return false;
37
}
38
39
return (bool)$object->getParticipantIfExists($viewer_phid);
40
}
41
42
public function getValueControlType() {
43
return self::CONTROL_TYPE_NONE;
44
}
45
46
}
47
48