Changes between Version 19 and Version 20 of Modules/Auth


Ignore:
Timestamp:
2011-01-13T18:42:31+01:00 (14 years ago)
Author:
Morris Swertz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Modules/Auth

    v19 v20  
    4141Goal: to have a first version of the Authorization module that fulfills at least the 'must' requirements.
    4242
     43=== Static permissions: entity and field level ===
     44
     45The expected user interface is a switch board were the admin can tick which entities, fields or screens the user has permissions on.
     46For example:
     47{{{
     48Role: lab worker
     49
     50Permission:
     51Entity             Read     Write   Execute  Ownerschip
     52Investigation      [x]      [ ]     [ ]      [ ]
     53Sample             [x]      [x]     [ ]      [x]
     54etc
     55}}}
     56
     57Proposed solution:
    4358 * Users will be stored in the !MolgenisUser table. Furthermore, there will be one Administrator and one Public User.
    4459 * Table rights: these will be managed through a new bridge table in which each row links to a !MolgenisEntity (through its name) and a !MolgenisUser. There will also be a field 'rights' that details the kind of authorization (an enum consisting of read, write, execute and owner). This way we can achieve many-to-many relationships.
    4560 * Column rights: these we can achieve through an extra, optional field in the Table rights table. This field can contain a name of a field (column) in the table in question. If none is supplied, the entry is supposed to hold for all fields in the table. If one is supplied, the entry is supposed to hold only for the specified field. There can be multiple entries in the bridge table for a certain table. In that case, the more detailed entries (about columns) take precedence over the more general ones (about tables as a whole).
     61
     62Proposed solution (rewritten to see if we understand each other):
     63* !MogenisEntity and !MolgenisField and !MolgenisScreen are subclasses of !MolgenisElement. Thus we have an extensible way to define elements we want to set permissions on.
     64* !MolgenisRole can have zero or more !MolgenisPermission, with each permission being a tuple [role: xref->MolgenisRole, element:xref->MolgenisModelElement, permission: enum[read,write,execute,ownership]]. [[BR]]Thus we can assign permissions to role
     65* !MolgenisUser extends !MolgenisRole with password to enable authentication. [[BR]]Thus we can easily assign permissions to an individual.
     66* !MolgenisUser can have multiple !MolgenisRole and !MolgenisRole can have multiple !MolgenisUser. [[BR]]Thus we can easily assign a set of permissions to multiple individuals.
     67* !MolgenisGroup extends !MolgenisRole to allow the definition of groups of people (instead of groups of permissions). See row-level security.
     68* there will be one Administrator and one Public User.
     69* For each individual the total set of permissions is calculated and broader permissions overrule narrow permissions (e.g. entity permission implies permissions on all fields, ownership implies read and write]
     70
     71Decisions:
     72* permission field in MolgenisPermission could be xref instead of enum. Advantage: open ended. Drawback: harder to program.
     73* !MolgenisElement could be made generic so you don't need subclasses. Advantage: easier to program. Drawback: loose information that we may want to use in other places.
     74
     75
     76== Dynamic permissions: row level security or 'sharing' ==
     77
     78Expected user interface during editing:
     79{{{
     80> Sharing details [hide]
     81
     82Owner:     me
     83Can view:  Maggie (user) [-][+]
     84Can edit:  John (user) [-]
     85           My best friends (group) [-][+]
     86}}}
     87
     88Proposed solution1: big helper table
    4689 * Row rights: for this we introduce another optional field in the Table rights table, namely an xref to a row in the table in question. Every row already has an (autogenerated) id field so this is easily done. With this extra field in place we can have very specific entries detailing what rights a certain user has on a combination of a column and a row in a certain table (so we can in fact have "cell rights"). The remark about precedence for the column rights also holds for this.
    4790 * So we end up with one extra bridge table having entries for combinations of tables, columns, rows, users and kinds of rights. All queries should involve joins with this table to restrict the result set based on what the current user is allowed to see/edit/execute. We have to find out what this will do with the performance of our applications! Maybe it turns out that this "big table" approach is not feasible.
    4891 * We will add a plug-in to the Auth module where authenticated users can request rights on tables, columns and/or rows. The requests will be sent to the owners.
    4992 * We will add a plug-in to the Auth module where users can manage the rights on tables, columns and/or rows of which they are owners. Here they can see the current requests and act on them.
     93
     94Proposed solution 2: superclass
     95* There is an interface !RowLevelSecurity that contains fields [owner: mref->!MolgenisUser, shareRead: mref->!MolgenisRole, shareWrite: mref->!MolgenisRole]. [[BR]]Thus a user can choose to share data with the selected groups or individuals.
    5096
    5197[[BR]]