Page MenuHomePhabricator

Add a Phabricator policy capability "Can create Countdowns"
Closed, ResolvedPublicFeature

Description

Preface

Actually the cute Phabricator's Countdown application has a "Can Use Application " who decides both:

  • who can see Countdowns
  • who can create a Countdown

Now, the bad news (and this could cause some heart attack so please, those who are sensitive, leave this page before reading the next sentence):

Actually, only a small circle of evil people called Trusted-Contributors can see cute Countdowns.

Why? Because to protect us from spam we have this setup:

While this should be our preferred common sense use case:

Proposal

Following the Phabricator's Diffusion application policies that has a cute "Can Create Repositories" policy, it would be nice to introduce a new policy capability called "Can create Countdowns" to literally decide who can create a Countdown and restrict only that, instead of restricting who can see them as well.

In short, somewhere in the code we should add a:

$can_create = $this->hasApplicationCapability( PhabricatorCountdownCapabilityCreate::CAPABILITY );

Or something like that, creating the related class in phabricator/src/applications/countdown/capability/.

Event Timeline

I think this is a good idea. I'll see if it's as simple as just adding one line of code (probably not)

Given that many things take me years I think 6mo are quite alright :D (Thanks!)

I'll see if it's as simple as just adding one line of code (probably not)

But I kept a secret margin of error of ±24 :^)

Thank you for your work @mmodell!

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 13 2021, 11:41 AM
Aklapper assigned this task to mmodell.

Since rPHABde1ec2c9e1dcff469239fc7d58ee2aad1d85497f , "Can Create Countdowns" is available for admins at https://phabricator.wikimedia.org/applications/view/PhabricatorCountdownApplication/ and is currently set to "All Users". Resolving.

Since rPHABde1ec2c9e1dcff469239fc7d58ee2aad1d85497f , "Can Create Countdowns" is available for admins at https://phabricator.wikimedia.org/applications/view/PhabricatorCountdownApplication/ and is currently set to "All Users". Resolving.

As the Task description, maybe it was better to set "Can Create Countdown" to Trusted-Contributors instead of "All Users" to prevent spam