Page MenuHomePhabricator

Naunce - capalities for Source object
ClosedPublic

Authored by btrahan on Nov 8 2013, 8:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 5, 7:06 AM
Unknown Object (File)
Sat, Aug 31, 8:15 PM
Unknown Object (File)
Fri, Aug 30, 6:24 AM
Unknown Object (File)
Thu, Aug 29, 6:43 PM
Unknown Object (File)
Wed, Aug 28, 11:44 AM
Unknown Object (File)
Mon, Aug 26, 9:20 AM
Unknown Object (File)
Sun, Aug 25, 9:12 PM
Unknown Object (File)
Sun, Aug 25, 7:06 PM

Details

Reviewers
epriestley
Commits
Restricted Diffusion Commit
rP3de4e91dacbf: Naunce - capalities for Source object
Summary

another little piece here that basically just adds some permissions to source editing. serving it up before I do anything too complicated to make sure it seems kosher. in terms of what comes next this form needs to be dynamic based on source type so there'll be some fun there. That said, I plan to implement a more simple "phabricator form" only version to start here and flesh out a few other things like queues with that.

Test Plan

set permission to no one for source edit and got a nice error page.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Minor inlines.

src/applications/nuance/capability/NuanceCapabilitySourceEdit.php
3 ↗(On Diff #16996)

Maybe call this "Create" or "Manage" to distinguish from the individual source edit permission.

src/applications/nuance/constants/NuanceSourceType.php
6–13

We should plan for these to eventually be decentralized/pluggable/definable by third parties, but this seems fine for now.

Maybe leave "0" undefined so "uninitialized" vs "internal" is clearly an error.

19

pht()

src/applications/nuance/controller/NuanceSourceEditController.php
103–104

We should dump this into a PHUIObjectBoxView at some point.

src/applications/nuance/constants/NuanceSourceType.php
6–13

In the existing codebase, what do you think is the best model for this decentralization?

btrahan updated this revision to Unknown Object (????).Nov 8 2013, 8:38 PM

updates as suggested

btrahan updated this revision to Unknown Object (????).Nov 8 2013, 8:41 PM

missed one s/edit/manage/g

I think the PHIDType and Capabilities stuff are both good examples, although they're more complex than this. Basically define some abstract base class and then figure out all the avialable "stuff" by using PhutilSymbolLoader.