mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Support "public" policy in Tokens
Summary: Ref T4830. Allows logged-out users to browse tokens, policies permitting. Test Plan: Browsed tokens as a logged-out user. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T4830 Differential Revision: https://secure.phabricator.com/D8828
This commit is contained in:
parent
27d426e3fe
commit
0cfc5aa0aa
4 changed files with 12 additions and 4 deletions
|
@ -103,7 +103,7 @@ return array(
|
||||||
'rsrc/css/application/slowvote/slowvote.css' => '266df6a1',
|
'rsrc/css/application/slowvote/slowvote.css' => '266df6a1',
|
||||||
'rsrc/css/application/subscriptions/subscribers-list.css' => '5bb30c78',
|
'rsrc/css/application/subscriptions/subscribers-list.css' => '5bb30c78',
|
||||||
'rsrc/css/application/tokens/tokens.css' => '5f7bca25',
|
'rsrc/css/application/tokens/tokens.css' => '5f7bca25',
|
||||||
'rsrc/css/application/uiexample/example.css' => 'd07a5869',
|
'rsrc/css/application/uiexample/example.css' => '81adeffe',
|
||||||
'rsrc/css/core/core.css' => 'da26ddb2',
|
'rsrc/css/core/core.css' => 'da26ddb2',
|
||||||
'rsrc/css/core/remarkup.css' => '0923dbd6',
|
'rsrc/css/core/remarkup.css' => '0923dbd6',
|
||||||
'rsrc/css/core/syntax.css' => '3c18c1cb',
|
'rsrc/css/core/syntax.css' => '3c18c1cb',
|
||||||
|
@ -722,7 +722,7 @@ return array(
|
||||||
'phabricator-textareautils' => 'b3ec3cfc',
|
'phabricator-textareautils' => 'b3ec3cfc',
|
||||||
'phabricator-tooltip' => '3915d490',
|
'phabricator-tooltip' => '3915d490',
|
||||||
'phabricator-transaction-view-css' => 'ce491938',
|
'phabricator-transaction-view-css' => 'ce491938',
|
||||||
'phabricator-ui-example-css' => 'd07a5869',
|
'phabricator-ui-example-css' => '81adeffe',
|
||||||
'phabricator-uiexample-javelin-view' => 'd4a14807',
|
'phabricator-uiexample-javelin-view' => 'd4a14807',
|
||||||
'phabricator-uiexample-reactor-button' => '44524435',
|
'phabricator-uiexample-reactor-button' => '44524435',
|
||||||
'phabricator-uiexample-reactor-checkbox' => '7ba325ee',
|
'phabricator-uiexample-reactor-checkbox' => '7ba325ee',
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
final class PhabricatorTokenGivenController extends PhabricatorTokenController {
|
final class PhabricatorTokenGivenController extends PhabricatorTokenController {
|
||||||
|
|
||||||
|
public function shouldAllowPublic() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function processRequest() {
|
public function processRequest() {
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
final class PhabricatorTokenLeaderController
|
final class PhabricatorTokenLeaderController
|
||||||
extends PhabricatorTokenController {
|
extends PhabricatorTokenController {
|
||||||
|
|
||||||
|
public function shouldAllowPublic() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function processRequest() {
|
public function processRequest() {
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
|
|
@ -20,7 +20,7 @@ final class PhabricatorToken extends PhabricatorTokenDAO
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPolicy($capability) {
|
public function getPolicy($capability) {
|
||||||
return PhabricatorPolicies::POLICY_USER;
|
return PhabricatorPolicies::getMostOpenPolicy();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
||||||
|
|
Loading…
Reference in a new issue