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
Tests Passed
Build Status
Buildable 1650
Build 1650: arc lint + arc unit

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