We should be able to specify acls that are additive as well as subtractive. To that end, we should update the acl structure to be a list of permission grants and revocations.
An ACL will consist of a list of tuples of the form (ALLOW/DENY, principal, permission). principal will be a ProjectRole. permissions is string, which may be *, indicating all permissions.
The has_access() will examine each tuple in the acl, followed by the "parent security context" acl, looking for a match with the current principal and the requested permission. If it finds a match, it uses the ALLOW/DENY field to determine whether the principal has the requested access. This terminates the list traversal. If it traverses both lists and doesn't find a match, it defaults to DENY. The parent security contexts are as follows:
There will be special logic to allow neighborhood admins to have any and all permissions for artifacts/tools/projects in their neighborhood.
Also as part of this ticket, project permissions are simplified and neighborhood permissions now delegate to the --init-- project for that neighborhood.
Tickets: #1787
Tickets: #1940
Tickets: #1955
Tickets: #1985
Tickets: #2058
Diff:
Diff:
on rc/1909, forge and forge-classic
QA:
For deployment, the DB should be backed up and webapp, taskd, etc. should be stopped. Then run the following commands:
Diff:
Needs docstrings including a general overview of the underlying permissions algorithm, and rebasing to dev; but the code looks good otherwise. Will want to re-review after docstrings are added to make sure I understood everything correctly.
Remaining work is a 1; the rest went into other tickets, most recently [#1985]
Related
Tickets:
#1985