Exemple #1
0
def update_collection_access(collection_id):
    """Re-write all etities in this collection to reflect updated roles."""
    collection = Collection.by_id(collection_id)
    if collection is None:
        return
    log.info("Update roles [%s]: %s", collection.foreign_id, collection.label)
    index.update_collection_roles(collection)
Exemple #2
0
 def grant(self, collection, role, read, write):
     Permission.grant(collection, role, read, write)
     db.session.commit()
     update_collection(collection)
     update_collection_roles(collection)
     self.flush_index()