#1909 Update ACL system so it's actually a list, letting us allow and deny - NEEDS SCRIPT

v1.0.0
closed
Wolf
sf-1 (616)
General
nobody
2015-08-20
2011-04-07
No

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:

  • Artifact => App
  • Project => parent Project

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.

Related

Tickets: #1787
Tickets: #1940
Tickets: #1955
Tickets: #1985
Tickets: #2058

Discussion

  • Rick Copeland - 2011-04-13
    • size: --> 4
     
  • Rick Copeland - 2011-04-13
    • Description has changed:

    Diff:

    --- old 
    +++ new 
    @@ -1,1 +1,7 @@
     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*, *permissions*). *principal* will generally be a ProjectRole but can also be None, indicating all users. *permissions* is a list of strings, which may include *, indicating all permissions.
    +
    +The has_artifact_access() will examine each tuple in the artifact list, followed by the tool 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.
    +
    +There will be special logic to allow neighborhood admins to have any and all permissions.
    
     
  • Rick Copeland - 2011-04-13
    • status: open --> in-progress
    • assigned_to: Rick Copéland
    • milestone: apr-21 --> apr-14
     
  • Rick Copeland - 2011-04-13
    • size: 4 --> 8
     
  • Dave Brondsema

    Dave Brondsema - 2011-04-14
    • size: 8 --> 4
     
  • Rick Copeland - 2011-04-15
    • summary: Update ACL system so it's actually a list, letting us allow and deny --> Update ACL system so it's actually a list, letting us allow and deny - NEEDS SCRIPT
    • Description has changed:

    Diff:

    --- old 
    +++ new 
    @@ -1,7 +1,10 @@
     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*, *permissions*). *principal* will generally be a ProjectRole but can also be None, indicating all users. *permissions* is a list of strings, which may include *, indicating all permissions.
    -
    -The has_artifact_access() will examine each tuple in the artifact list, followed by the tool 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.
    -
    -There will be special logic to allow neighborhood admins to have any and all permissions.
    +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:
    +
    +* Artifact => App
    +* Project => parent Project
    +
    +There will be special logic to allow neighborhood admins to have any and all permissions for artifacts/tools/projects in their neighborhood.
    
    • status: in-progress --> code-review
    • assigned_to: Rick Copéland --> Wolf
     
  • Rick Copeland - 2011-04-15

    on rc/1909, forge and forge-classic

    QA:

    • create a fresh DB on dev using paster setup-app development.ini
    • update to rc/1909
    • paster script development.ini ../scripts/update-acls.py test
    • paster script development.ini ../scripts/update-acls.py
    • Verify that the site enforces neighborhood, project, and tool permissions appropriately

    For deployment, the DB should be backed up and webapp, taskd, etc. should be stopped. Then run the following commands:

    # all logging goes to /var/log/allura/allura.log
    allurapaste script /var/local/config/production.ini ../scripts/update-acls.py test
    # verify output, no tracebacks
    allurapaste script /var/local/config/production.ini ../scripts/update-acls.py 
    # verify output, no tracebacks
    
    • Description has changed:

    Diff:

    --- old 
    +++ new 
    @@ -8,3 +8,5 @@
     * Project => parent Project
    
     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.
    
     
  • Wolf - 2011-04-19
    • assigned_to: Wolf --> Rick Copéland
     
  • Wolf - 2011-04-19

    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.

     
  • Dave Brondsema

    Dave Brondsema - 2011-04-20
    • size: 4 --> 1
     
  • Dave Brondsema

    Dave Brondsema - 2011-04-20

    Remaining work is a 1; the rest went into other tickets, most recently [#1985]

    • milestone: apr-21 --> may-05
     

    Related

    Tickets: #1985

  • Rick Copeland - 2011-04-25
    • assigned_to: Rick Copéland --> Wolf
     
  • Dave Brondsema

    Dave Brondsema - 2011-04-26
    • milestone: may-05 --> apr-28
     
  • Rick Copeland - 2011-04-27
    • status: code-review --> closed
     

Log in to post a comment.