allows for the role name or description to be modified
195564
def updateRole(self, roleID, name, description):
        """"""
        params = {
            "name" : name,
            "description" : description,
            "f" : "json"
        }
        url = self._url + "/%s/update"
        return self._post(url=url,
                             param_dict=params,
                             proxy_url=self._proxy_url,
                             proxy_port=self._proxy_port)
1352804
def update(self, name, modifiers):
        """"""
        self.update_name(name)
        self.modifiers = modifiers
78601
def role(self, value):
        
        if value == self._defaults['ai.cloud.role'] and 'ai.cloud.role' in self._values:
            del self._values['ai.cloud.role']
        else:
            self._values['ai.cloud.role'] = value
1017549
def modify_kls(self, name):
        """"""
        if self.kls is None:
            self.kls = name
        else:
            self.kls += name
894336
function stringifyRole(role){
  if (typeof role == 'string')
    return role;

  if (!role)
    return '';

  return [
    role.role || '',
    role.roleId ? '(' + role.roleId + ')' : '',
    role.subrole ? '/' + role.subrole : ''
  ].join('');
}
1280114
def standardize_role(role):
    """"""
    role = role.lower()
    if any(c in role for c in {'synthesis', 'give', 'yield', 'afford', 'product', 'preparation of'}):
        return 'product'
    return role
459650
@Programmatic
    public ApplicationRole newRole(
            final String name,
            final String description) {
        ApplicationRole role = findByName(name);
        if (role == null){
            role = getApplicationRoleFactory().newApplicationRole();
            role.setName(name);
            role.setDescription(description);
            container.persist(role);
        }
        return role;
    }
718623
def put(self, user_id):
        """"""
        self.reqparse.add_argument('roles', type=str, action='append')
        args = self.reqparse.parse_args()
        auditlog(event='user.create', actor=session['user'].username, data=args)

        user = db.User.find_one(User.user_id == user_id)
        roles = db.Role.find(Role.name.in_(args['roles']))
        if not user:
            return self.make_response('No such user found: {}'.format(user_id), HTTP.NOT_FOUND)

        if user.username == 'admin' and user.auth_system == 'builtin':
            return self.make_response('You cannot modify the built-in admin user', HTTP.FORBIDDEN)

        user.roles = []
        for role in roles:
            if role in args['roles']:
                user.roles.append(role)

        db.session.add(user)
        db.session.commit()

        return self.make_response({'message': 'User roles updated'}, HTTP.OK)
582892
def add_role(self, name, **attrs):
        
        return Roles(self.requester).create(self.id, name, **attrs)
1139283
def set_role_perm(role_id, perm_id,**kwargs):
    
    #check_perm(kwargs.get('user_id'), 'edit_perm')

    _get_perm(perm_id)
    role_i = _get_role(role_id)
    roleperm_i = RolePerm(role_id=role_id, perm_id=perm_id)

    role_i.roleperms.append(roleperm_i)

    db.DBSession.flush()

    return role_i
1058669
public Result<Void> addRole(AuthzTrans trans, PermDAO.Data perm, String roleFullName) {
		// Note: Prepared Statements for Collection updates aren't supported
		//ResultSet rv =
		try {
			getSession(trans).execute(UPDATE_SP + TABLE + " SET roles = roles + {'"	+ roleFullName + "'} " +
				"WHERE " +
					"ns = '" + perm.ns + "' AND " +
					"type = '" + perm.type + "' AND " +
					"instance = '" + perm.instance + "' AND " +
					"action = '" + perm.action + "';"
					);
		} catch (DriverException | APIException | IOException e) {
			reportPerhapsReset(trans,e);
			return Result.err(Result.ERR_Backend, CassAccess.ERR_ACCESS_MSG);
		}

		wasModified(trans, CRUD.update, perm, "Added role " + roleFullName + " to perm " +
				perm.ns + '.' + perm.type + '|' + perm.instance + '|' + perm.action);
		return Result.ok();
	}
651962
public function addMissingRoles()
    {
        if (!get_role('author')) {
            add_role(
                'author',
                'Author',
                array(
                    'upload_files'           => true,
                    'edit_posts'             => true,
                    'edit_published_posts'   => true,
                    'publish_posts'          => true,
                    'read'                   => true,
                    'level_2'                => true,
                    'level_1'                => true,
                    'level_0'                => true,
                    'delete_posts'           => true,
                    'delete_published_posts' => true
                )
            );

            delete_option('_author_role_bkp');
        }
    }
892191
def CanSetRoleTo(self, Role):
        
        t = self._Owner._Alter('CHATMEMBER', self.Id, 'CANSETROLETO', Role,
                               'ALTER CHATMEMBER CANSETROLETO')
        return (chop(t, 1)[-1] == 'TRUE')
182604
def print_role(role, detailed=True):
    """"""
    if detailed:
        print(colors.yellow(role.get('fullname')))
    else:
        print("  Role: {0}".format(role.get('fullname')))
    if detailed:
        print("    description: {0}".format(role.get('description')))
    if 'default_attributes' in role:
        print("    default_attributes:")
        _pprint(role['default_attributes'])
    if 'override_attributes' in role:
        print("    override_attributes:")
        _pprint(role['override_attributes'])
    if detailed:
        print("    run_list: {0}".format(role.get('run_list')))
    print("")
91810
def update_name(self, name):
        """"""
        if name != self.name:
            self.parent.types[name] = self
            del self.parent.types[self.name]
            self.name = name
857767
def name_build(self, name, is_policy=False, prefix=True):
        
        str = name

        # Add prefix
        if prefix:
            str = self.__role_name_prefix + str

        # Add policy suffix
        if is_policy:
            str = str + "-policy"

        return str
1339243
def roles_remove(user, role):
    """"""
    user, role = _datastore._prepare_role_modify_args(user, role)
    if user is None:
        raise click.UsageError('Cannot find user.')
    if role is None:
        raise click.UsageError('Cannot find role.')
    if _datastore.remove_role_from_user(user, role):
        click.secho('Role "{0}" removed from user "{1}" '
                    'successfully.'.format(role, user), fg='green')
    else:
        raise click.UsageError('Cannot remove role from user.')