Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93589477
PhabricatorOAuthClientAuthorization.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
Fri, Nov 29, 23:46
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 23:46 (2 d)
Engine
blob
Format
Raw Data
Handle
22668541
Attached To
rPH Phabricator
PhabricatorOAuthClientAuthorization.php
View Options
<?php
final
class
PhabricatorOAuthClientAuthorization
extends
PhabricatorOAuthServerDAO
implements
PhabricatorPolicyInterface
{
protected
$userPHID
;
protected
$clientPHID
;
protected
$scope
;
public
function
getEditURI
()
{
return
'/oauthserver/clientauthorization/edit/'
.
$this
->
getPHID
().
'/'
;
}
public
function
getDeleteURI
()
{
return
'/oauthserver/clientauthorization/delete/'
.
$this
->
getPHID
().
'/'
;
}
public
function
getScopeString
()
{
$scope
=
$this
->
getScope
();
$scopes
=
array_keys
(
$scope
);
sort
(
$scopes
);
return
implode
(
' '
,
$scopes
);
}
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_SERIALIZATION
=>
array
(
'scope'
=>
self
::
SERIALIZATION_JSON
,
),
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
PhabricatorOAuthServerPHIDTypeClientAuthorization
::
TYPECONST
);
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
switch
(
$capability
)
{
case
PhabricatorPolicyCapability
::
CAN_VIEW
:
return
PhabricatorPolicies
::
POLICY_NOONE
;
}
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
(
$viewer
->
getPHID
()
==
$this
->
getUserPHID
());
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
pht
(
'Authorizations can only be viewed by the authorizing user.'
);
}
}
Event Timeline
Log In to Comment