1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 16:30:59 +01:00
phorge-phorge/src/applications/people
epriestley e46826ad36 Introduce CAN_EDIT for ExternalAccount, and make CAN_VIEW more liberal
Summary:
Fixes T3732. Ref T1205. Ref T3116.

External accounts (like emails used as identities, Facebook accounts, LDAP accounts, etc.) are stored in "ExternalAccount" objects.

Currently, we have a very restrictive `CAN_VIEW` policy for ExternalAccounts, to add an extra layer of protection to make sure users can't use them in unintended ways. For example, it would be bad if a user could link their Phabricator account to a Facebook account without proper authentication. All of the controllers which do sensitive things have checks anyway, but a restrictive CAN_VIEW provided an extra layer of protection. Se T3116 for some discussion.

However, this means that when grey/external users take actions (via email, or via applications like Legalpad) other users can't load the account handles and can't see anything about the actor (they just see "Restricted External Account" or similar).

Balancing these concerns is mostly about not making a huge mess while doing it. This seems like a reasonable approach:

  - Add `CAN_EDIT` on these objects.
  - Make that very restricted, but open up `CAN_VIEW`.
  - Require `CAN_EDIT` any time we're going to do something authentication/identity related.

This is slightly easier to get wrong (forget CAN_EDIT) than other approaches, but pretty simple, and we always have extra checks in place anyway -- this is just a safety net.

I'm not quite sure how we should identify external accounts, so for now we're just rendering "Email User" or similar -- clearly not a bug, but not identifying. We can figure out what to render in the long term elsewhere.

Test Plan:
  - Viewed external accounts.
  - Linked an external account.
  - Refreshed an external account.
  - Edited profile picture.
  - Viewed sessions panel.
  - Published a bunch of stuff to Asana/JIRA.
  - Legalpad signature page now shows external accounts.

{F171595}

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3732, T1205, T3116

Differential Revision: https://secure.phabricator.com/D9767
2014-07-10 10:18:10 -07:00
..
application (Redesign) Clean up older "Tile" code 2014-06-03 15:47:27 -07:00
capability Add a granular capability for user directory browsing 2014-01-30 11:53:49 -08:00
conduit Remove @group annotations 2014-07-10 08:12:48 +10:00
config Change double quotes to single quotes. 2014-06-09 11:36:50 -07:00
controller Introduce CAN_EDIT for ExternalAccount, and make CAN_VIEW more liberal 2014-07-10 10:18:10 -07:00
customfield Only show profile status when calendar app installed 2014-06-16 14:18:51 -07:00
editor Change double quotes to single quotes. 2014-06-09 11:36:50 -07:00
event Check for calendar before settings status 2014-06-16 12:18:25 -07:00
garbagecollector Add a GC for user logs 2014-02-03 10:51:41 -08:00
lipsum Change double quotes to single quotes. 2014-06-09 11:36:50 -07:00
phid Make named lookup of users case insensitive 2014-06-10 12:17:23 -07:00
query Allow users to select QueryPanel search engines from a list 2014-06-12 13:22:20 -07:00
remarkup Remove @group annotations 2014-07-10 08:12:48 +10:00
search Add config to require real name, respect config when creating new users, drop real name from full name if not provided. 2014-05-12 09:51:41 -07:00
storage Introduce CAN_EDIT for ExternalAccount, and make CAN_VIEW more liberal 2014-07-10 10:18:10 -07:00
view Let users review their own account activity logs 2014-04-27 17:32:09 -07:00