Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/chatlog/storage/PhabricatorChatLogChannel.php
12242 views
1
<?php
2
3
final class PhabricatorChatLogChannel
4
extends PhabricatorChatLogDAO
5
implements PhabricatorPolicyInterface {
6
7
protected $serviceName;
8
protected $serviceType;
9
protected $channelName;
10
protected $viewPolicy;
11
protected $editPolicy;
12
13
protected function getConfiguration() {
14
return array(
15
self::CONFIG_COLUMN_SCHEMA => array(
16
'serviceName' => 'text64',
17
'serviceType' => 'text32',
18
'channelName' => 'text64',
19
),
20
self::CONFIG_KEY_SCHEMA => array(
21
'key_channel' => array(
22
'columns' => array('channelName', 'serviceType', 'serviceName'),
23
'unique' => true,
24
),
25
),
26
) + parent::getConfiguration();
27
}
28
29
public function getCapabilities() {
30
return array(
31
PhabricatorPolicyCapability::CAN_VIEW,
32
PhabricatorPolicyCapability::CAN_EDIT,
33
);
34
}
35
36
public function getPolicy($capability) {
37
switch ($capability) {
38
case PhabricatorPolicyCapability::CAN_VIEW:
39
return $this->viewPolicy;
40
break;
41
case PhabricatorPolicyCapability::CAN_EDIT:
42
return $this->editPolicy;
43
break;
44
}
45
}
46
47
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
48
return false;
49
}
50
51
}
52
53