Page MenuHomePhorge

Allow customizing default Phurl view and edit policies
AcceptedPublic

Authored by taavi on Sun, Dec 8, 10:37.

Details

Summary
BeforeAfter
BEFORE.png (701×504 px, 36 KB)
AFTER.png (701×504 px, 43 KB)

Closes T15970

Test Plan

Diff Detail

Repository
rP Phorge
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 1649
Build 1649: arc lint + arc unit

Unit TestsFailed

TimeTest
0 msPhabricatorCelerityTestCase::testCelerityMaps
EXCEPTION (RuntimeException): Code coverage needs to be enabled in php.ini by setting 'xdebug.mode' to 'coverage' #0 [internal function]: PhutilErrorHandler::handleError(2, '...', '...', 708) #1 /home/taavi/src/phorge/docker-phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(708): xdebug_start_code_coverage(3)
0 msPhabricatorConduitTestCase::testConduitMethods
EXCEPTION (RuntimeException): Code coverage needs to be enabled in php.ini by setting 'xdebug.mode' to 'coverage' #0 [internal function]: PhutilErrorHandler::handleError(2, '...', '...', 708) #1 /home/taavi/src/phorge/docker-phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(708): xdebug_start_code_coverage(3)
0 msPhabricatorInfrastructureTestCase::testApplicationsInstalled
EXCEPTION (RuntimeException): Code coverage needs to be enabled in php.ini by setting 'xdebug.mode' to 'coverage' #0 [internal function]: PhutilErrorHandler::handleError(2, '...', '...', 708) #1 /home/taavi/src/phorge/docker-phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(708): xdebug_start_code_coverage(3)
0 msPhabricatorInfrastructureTestCase::testRejectMySQLNonUTF8Queries
EXCEPTION (RuntimeException): Code coverage needs to be enabled in php.ini by setting 'xdebug.mode' to 'coverage' #0 [internal function]: PhutilErrorHandler::handleError(2, '...', '...', 708) #1 /home/taavi/src/phorge/docker-phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(708): xdebug_start_code_coverage(3)
0 msPhabricatorLibraryTestCase::testEverythingImplemented
EXCEPTION (RuntimeException): Code coverage needs to be enabled in php.ini by setting 'xdebug.mode' to 'coverage' #0 [internal function]: PhutilErrorHandler::handleError(2, '...', '...', 708) #1 /home/taavi/src/phorge/docker-phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(708): xdebug_start_code_coverage(3)
View Full Test Results (7 Failed)

Event Timeline

taavi requested review of this revision.Sun, Dec 8, 10:37

Fix my local unit test config

src/applications/phurl/application/PhabricatorPhurlApplication.php
83

Note that this is different than the previous default (which allowed the URL creator only). I didn't find a way to make the policy default include the URL author, and the author will continue to have access since the URL class uses hasAutomaticCapability to always grant the author view/edit access.

Uuuh! Thanks <3

What happens to already-existing URLs? Maybe nice to mention in the test plan

What happens to already-existing URLs? Maybe nice to mention in the test plan

The policies for those are saved in the database, so they stay as is. Done.

src/applications/phurl/application/PhabricatorPhurlApplication.php
83
aklapper added inline comments.
src/applications/phurl/application/PhabricatorPhurlApplication.php
83

Could you clarify? src/applications/policy/constants/PhabricatorPolicies.php defines const POLICY_ADMIN = 'admin'

aklapper requested changes to this revision.Tue, Dec 10, 09:30
aklapper edited the test plan for this revision. (Show Details)

Oh true, got it. Have to replace PhabricatorPolicyCapability::POLICY_ADMIN, with 'capability' => PhabricatorPolicies::POLICY_ADMIN, here

This revision now requires changes to proceed.Tue, Dec 10, 09:31
valerio.bozzolan edited the test plan for this revision. (Show Details)

I like it :) Thanks! It works on my machine following the test plan.

sgtm

This revision is now accepted and ready to land.Wed, Dec 11, 10:38