def _roles(self, id): """ Lists and changes the person's roles. """ c.person = Person.find_by_id(id) c.roles = Role.find_all() role = self.form_result['role'] action = self.form_result['action'] role = Role.find_by_name(name=role) if action == 'Revoke' and role in c.person.roles: c.person.roles.remove(role) h.flash('Role ' + role.name + ' Revoked') elif action == 'Grant' and role not in c.person.roles: c.person.roles.append(role) h.flash('Role ' + role.name + ' Granted') else: h.flash("Nothing to do") meta.Session.commit() return render('person/roles.mako')
def roles(self, id): c.person = Person.find_by_id(id) c.roles = Role.find_all() return render('person/roles.mako')
def index(self): c.role_collection = Role.find_all() return render('/role/list.mako')