Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F117824881
PhabricatorPolicyRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jun 16, 03:57
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Jun 18, 03:57 (2 d)
Engine
blob
Format
Raw Data
Handle
26804129
Attached To
rPH Phabricator
PhabricatorPolicyRule.php
View Options
<?php
abstract
class
PhabricatorPolicyRule
{
const
CONTROL_TYPE_TEXT
=
'text'
;
const
CONTROL_TYPE_SELECT
=
'select'
;
const
CONTROL_TYPE_TOKENIZER
=
'tokenizer'
;
const
CONTROL_TYPE_NONE
=
'none'
;
abstract
public
function
getRuleDescription
();
abstract
public
function
applyRule
(
PhabricatorUser
$viewer
,
$value
);
public
function
willApplyRules
(
PhabricatorUser
$viewer
,
array
$values
)
{
return
;
}
public
function
getValueControlType
()
{
return
self
::
CONTROL_TYPE_TEXT
;
}
public
function
getValueControlTemplate
()
{
return
null
;
}
public
function
getRuleOrder
()
{
return
500
;
}
public
function
getValueForStorage
(
$value
)
{
return
$value
;
}
public
function
getValueForDisplay
(
PhabricatorUser
$viewer
,
$value
)
{
return
$value
;
}
public
function
getRequiredHandlePHIDsForSummary
(
$value
)
{
$phids
=
array
();
switch
(
$this
->
getValueControlType
())
{
case
self
::
CONTROL_TYPE_TOKENIZER
:
$phids
=
$value
;
break
;
case
self
::
CONTROL_TYPE_TEXT
:
case
self
::
CONTROL_TYPE_SELECT
:
case
self
::
CONTROL_TYPE_NONE
:
default
:
if
(
phid_get_type
(
$value
)
!=
PhabricatorPHIDConstants
::
PHID_TYPE_UNKNOWN
)
{
$phids
=
array
(
$value
);
}
else
{
$phids
=
array
();
}
break
;
}
return
$phids
;
}
/**
* Return true if the given value creates a rule with a meaningful effect.
* An example of a rule with no meaningful effect is a "users" rule with no
* users specified.
*
* @return bool True if the value creates a meaningful rule.
*/
public
function
ruleHasEffect
(
$value
)
{
return
true
;
}
}
Event Timeline
Log In to Comment