Updates ACL roles.
761242
public function updateAclRoles(AdminObjectAclData $data)
    {
        $aclValues = $data->getAclRoles();
        $form = $data->getAclRolesForm();

        $this->buildAcl($data, $form, $aclValues);
    }
1242587
def _acl_changes(name, id=None, type=None, rules=None, consul_url=None, token=None):
    '''
       
    '''
    info = __salt__['consul.acl_info'](id=id, token=token, consul_url=consul_url)

    if info['res'] and info['data'][0]['Name'] != name:
        return True
    elif info['res'] and info['data'][0]['Rules'] != rules:
        return True
    elif info['res'] and info['data'][0]['Type'] != type:
        return True
    else:
        return False
804832
public function update(Role $role)
    {
        $this->validate($this->request, [
            'name'        => 'required',
            'slug'        => 'required|unique:roles,slug,' . $role->id,
        ]);

        $role->name = $this->request->get('name');
        if (! $role->system) {
            $role->slug = $this->request->get('slug');
        }
        $role->save();

        $role->syncPermissions($this->request->get('permissions', []));
        flash()->success('Role ' . $role->name . ' successfully updated!');

        return redirect()->route('administrator.roles.index');
    }
1074447
public Acl updateAcl() {
    // [START updateAcl]
    Acl acl = blob.updateAcl(Acl.of(User.ofAllAuthenticatedUsers(), Acl.Role.OWNER));
    // [END updateAcl]
    return acl;
  }
812361
def permissions_update(principal_id, permission_id)
      response = service.permissions_update(
        acl_id: self.id,
        principal_id: principal_id,
        permission_id: permission_id
      )

      response.at_xpath('//status').attr('code') == 'ok'
    end
639022
@Override
    public void update(IPermission[] perms) throws AuthorizationException {
        if (perms.length > 0) {
            try {
                primUpdate(perms);
            } catch (Exception ex) {
                log.error("Exception updating permissions " + Arrays.toString(perms), ex);
                throw new AuthorizationException(ex);
            }
        }
    }
106928
def update_role(role,**kwargs):
    
    #check_perm(kwargs.get('user_id'), 'edit_role')
    try:
        role_i = db.DBSession.query(Role).filter(Role.id==role.id).one()
        role_i.name = role.name
        role_i.code = role.code
    except NoResultFound:
        raise ResourceNotFoundError("Role (role_id=%s) does not exist"%(role.id))

    for perm in role.permissions:
        _get_perm(perm.id)
        roleperm_i = RolePerm(role_id=role.id,
                              perm_id=perm.id
                              )

        db.DBSession.add(roleperm_i)

    for user in role.users:
        _get_user(user.id)
        roleuser_i = RoleUser(user_id=user.id,
                                         perm_id=perm.id
                                        )

        db.DBSession.add(roleuser_i)

    db.DBSession.flush()
    return role_i
302609
protected function updateInheritancePermissions()
    {
        foreach ($this->inheritancePermissions() as $role => $items) {
            foreach ($items as $item) {
                $this->authManager
                    ->addChild(RbacFactory::Role($role), RbacFactory::Permission($item));

                echo sprintf('    > role `%s` inherited permission `%s`.', $role, $item) . PHP_EOL;
            }
        }
    }
1012712
public void updatePermissions() {
    final String[] accessViewerList =
        this.accessViewer.trim().split(ACCESS_LIST_SPLIT_REGEX);
    final String[] accessExecutorList =
        this.accessExecutor.trim().split(ACCESS_LIST_SPLIT_REGEX);
    final String[] accessOwnerList =
        this.accessOwner.trim().split(ACCESS_LIST_SPLIT_REGEX);
    // Prepare permission types
    final Permission admin = new Permission();
    admin.addPermission(Type.READ);
    admin.addPermission(Type.EXECUTE);
    admin.addPermission(Type.ADMIN);
    final Permission executor = new Permission();
    executor.addPermission(Type.READ);
    executor.addPermission(Type.EXECUTE);
    final Permission viewer = new Permission();
    viewer.addPermission(Type.READ);
    // Sets the permissions
    this.project.clearUserPermission();
    for (String user : accessViewerList) {
      user = user.trim();
      if (!user.isEmpty()) {
        this.project.setUserPermission(user, viewer);
      }
    }
    for (String user : accessExecutorList) {
      user = user.trim();
      if (!user.isEmpty()) {
        this.project.setUserPermission(user, executor);
      }
    }
    for (String user : accessOwnerList) {
      user = user.trim();
      if (!user.isEmpty()) {
        this.project.setUserPermission(user, admin);
      }
    }
    this.project.setUserPermission(this.reportalUser, admin);
  }
1341574
def update(self, permission):
        
        data = values.of({'Permission': serialize.map(permission, lambda e: e), })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return RoleInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
86459
function (userId, doc, fieldNames, modifier) {
			// only admins can update user roles via the client
			return Users.isAdmin(userId) || (doc._id === userId && fieldNames.indexOf("roles") < 0);
		}
1281278
def set_def_canned_acl(self, acl_str, key_name='', headers=None):
        """"""
        return self.set_canned_acl_helper(acl_str, key_name, headers, 
                                          query_args=DEF_OBJ_ACL)
1350112
def update
      authorize! :update, @membership
      if @membership.update(membership_params)
        redirect_to participant_path(@participant),
                    notice: "Group assignment was successfully updated."
      else
        flash[:alert] = @membership.errors.full_messages.join(", ")
        flash[:alert] += "End date cannot be set prior to tomorrow's date. " \
                           "Please use [Discontinue] or [Terminate Access] " \
                           "from the patient dashboard."
        render :edit
      end
    end
1347125
def config_set_acl(args):
    
    acl_updates = [{"user": user, "role": args.role} \
                   for user in set(expand_fc_groups(args.users)) \
                   if user != fapi.whoami()]

    id = args.snapshot_id
    if not id:
        # get the latest snapshot_id for this method from the methods repo
        r = fapi.list_repository_configs(namespace=args.namespace,
                                         name=args.config)
        fapi._check_response_code(r, 200)
        versions = r.json()
        if len(versions) == 0:
            if fcconfig.verbosity:
                eprint("Configuration {0}/{1} not found".format(args.namespace,
                                                                args.config))
            return 1
        latest = sorted(versions, key=lambda c: c['snapshotId'])[-1]
        id = latest['snapshotId']

    r = fapi.update_repository_config_acl(args.namespace, args.config, id,
                                          acl_updates)
    fapi._check_response_code(r, 200)
    if fcconfig.verbosity:
        print("Updated ACL for {0}/{1}:{2}".format(args.namespace, args.config,
                                                   id))
    return 0
605882
public void setRoles(java.util.Collection<PermissionInfo> roles) {
        if (roles == null) {
            this.roles = null;
            return;
        }

        this.roles = new java.util.ArrayList<PermissionInfo>(roles);
    }
545276
public function up() {
        $admin = Role::admin();

        $acl = app('antares.acl')->make('antares');
        $memory = app('antares.memory')->make('component');
        $acl->attach($memory);
        $acl->roles()->attach([$admin->name]);

        $presentationActions = [
            'Admin List', //users
            'Preview Themes', 'Preview Frontend', //themes
            'Roles List', //roles
        ];

        $crudActions = [
            'User Create', 'User Update', 'User Delete', //users
            'Activate Theme', 'Upload Theme', 'Install Theme', //themes
            'Create Role', 'Edit Role', 'Delete Role', //roles            
            'Properties', 'Properties Update', //action properties
            'Manage Roles', 'Manage Acl', 'Manage Settings', //global            
        ];

        $acl->actions()->attach(array_merge($presentationActions, $crudActions));
        $acl->allow($admin->name, array_merge($presentationActions, $crudActions));
    }
190492
private function generateRolesAndPermissions()
    {
        if( empty($this->aclData) ) {
            $this->error('empty roles and permissions in "generateRolesAndPermissions" method');

            return;
        }

        foreach ( $this->aclData as $acl ) {
            $this->createPermissions($acl['acl']);
            $this->createRoles($acl['acl']);
        }

        $this->createRolesPermissions($this->aclData);
    }