Changes between Version 1 and Version 2 of BluePrintAuthorization


Ignore:
Timestamp:
06/18/10 11:53:15 (14 years ago)
Author:
Fran Boon
Comment:

Use like for multiple=True in JOIN

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintAuthorization

    v1 v2  
    3636       accessible = (table.reader_id == None)
    3737       for role in roles:
    38            accessible = accessible & (table.reader_id == role)
     38           accessible = accessible & (table.reader_id == str(role)) & (table.reader_id.like('%d|%' % role)) & (table.reader_id.like('%|%d|%' % role)) & (table.reader_id.like('%|%d' % role))
    3939       query = deleted & accessible
    4040    return query
     
    4747    * Advantages:
    4848     * Combines the deleted into single API call
    49      * Single JOIN for optimal DB performance
    50     * Disadvantage:
    51      * Can we deal with Multiple=True?
     49     * Single JOIN for optimal DB performance (Assumption needs testing)
    5250   * Option 2: Do the check in Python after the initial query has returned
    53     * Advantage: Allows us to process the Multiple=True field properly
     51    * Advantage: Might have better performance than complex DB string?
    5452    * Disadvantage: More records pulled from DB than necessary
    5553  * writer_id check: All Write access goes via S3XRC so can be checked there (we can also develop an API call for Manual DAL access?)
     
    5755   * We expect relatively few groups per instance, so can use the checkboxes widget?
    5856   * Have a single checkbox for 'Restrict access' which then opens out the 2 fields.
     57=== Specific Examples ===
    5958 * A Person's Subscriptions shouldn't be visible by default.
    6059  * Admin or themselves is OK