'Refresh the Permissions'

def refresh_roles(self):

    current.s3db.s3_permission.truncate()
    auth = current.auth
    acl = auth.permission
    auth.s3_update_acls('ANONYMOUS', {'t': 'org_organisation', 'uacl': acl.READ}, {'c': 'org', 'f': 'sites_for_org', 'uacl': acl.READ})
    current.response.s3.crud_strings = Storage()
    from s3 import S3BulkImporter
    bi = S3BulkImporter()
    template = current.deployment_settings.get_template()
    filename = os.path.join(current.request.folder, 'modules', 'templates', template, 'auth_roles.csv')
    bi.import_role(filename)
    current.db.commit()
