victims / victims-web

The victims web application.
GNU Affero General Public License v3.0
8 stars 5 forks source link

Improve role handling #88

Closed abn closed 11 years ago

abn commented 11 years ago

Flask-Principals have issues with monoengine-sessions, might do a custom role mapping.

abn commented 11 years ago

This should now be complete

abn commented 11 years ago

Script to update the database:

db.users.find().forEach( function (x) {
    var roles = [];
    for (k in x.endorsements) {
        roles.push(k);
    }
    x.roles = roles;
    db.users.save(x);
} );

db.users.update({ "endorsements" : { $exists : true } }, { $unset: { "endorsements": "" }}, {"multi": true});