////////////////////////////////////////////////////////////////////////////////
// 'acl-check' subcommand.
182848
func cmdCheckACL(params Parameters) *subcommands.Command {
	return &subcommands.Command{
		Advanced:  true,
		UsageLine: "acl-check <package subpath> [options]",
		ShortDesc: "checks whether the caller has given roles in a package",
		LongDesc:  "Checks whether the caller has given roles in a package.",
		CommandRun: func() subcommands.CommandRun {
			c := &checkACLRun{}
			c.registerBaseFlags()
			c.clientOptions.registerFlags(&c.Flags, params, withoutRootDir)
			c.Flags.BoolVar(&c.owner, "owner", false, "Check for OWNER role.")
			c.Flags.BoolVar(&c.writer, "writer", false, "Check for WRITER role.")
			c.Flags.BoolVar(&c.reader, "reader", false, "Check for READER role.")
			return c
		},
	}
}
163021
private function scanRolesAndPermissions(): void
    {
        $files = $this->helper->getConfigFilesSorted();

        if (!empty($files)) {
            foreach ($files as $filePath) {
                $config = json_decode(file_get_contents($filePath), true);

                if (is_null($config)) {
                    $this->info('Invalid json file: ' . $filePath);
                } else {
                    $packageName = Arr::get($config, 'general.packageName');

                    if (is_null($packageName)) {
                        $this->error('SKIPPING! Package must have a name! file: ' . $filePath);
                        continue;
                    }

                    if (array_key_exists('acl', $config)) {
                        $this->aclData[] = [
                            'packageName' => $packageName,
                            'acl' => Arr::get($config, 'acl'),
                        ];
                    }
                }
            }
        }
    }
349785
private State checkArg(char command, String arg, State state)
            throws DatatypeException, IOException {
        int mant = 0;
        int mantDig = 0;
        boolean mantPos = true;
        boolean mantRead = false;

        int exp = 0;
        int expDig = 0;
        int expAdj = 0;
        boolean expPos = true;

        switch (state.current) {
            case '-':
                mantPos = false;
            case '+':
                state.current = state.reader.read();
                state = appendToContext(state);
        }

        m1: switch (state.current) {
            default:
                reportUnexpected(
                        arg + " for \u201c" + command + "\u201d command",
                        state.current, state.context);
                state = skipSubPath(state);
                return state;

            case '.':
                break;

            case '0':
                mantRead = true;
                l: for (;;) {
                    state.current = state.reader.read();
                    state = appendToContext(state);
                    switch (state.current) {
                        case '1':
                        case '2':
                        case '3':
                        case '4':
                        case '5':
                        case '6':
                        case '7':
                        case '8':
                        case '9':
                            break l;
                        case '.':
                        case 'e':
                        case 'E':
                            break m1;
                        default:
                            return state;
                        case '0':
                    }
                }

            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                mantRead = true;
                l: for (;;) {
                    if (mantDig < 9) {
                        mantDig++;
                        mant = mant * 10 + (state.current - '0');
                    } else {
                        expAdj++;
                    }
                    state.current = state.reader.read();
                    state = appendToContext(state);
                    switch (state.current) {
                        default:
                            break l;
                        case '0':
                        case '1':
                        case '2':
                        case '3':
                        case '4':
                        case '5':
                        case '6':
                        case '7':
                        case '8':
                        case '9':
                    }
                }
        }

        if (state.current == '.') {
            state.current = state.reader.read();
            state = appendToContext(state);
            m2: switch (state.current) {
                default:
                case 'e':
                case 'E':
                    if (!mantRead) {
                        reportNonNumber(command, state.current, state.context);
                        return state;
                    }
                    break;

                case '0':
                    if (mantDig == 0) {
                        l: for (;;) {
                            state.current = state.reader.read();
                            state = appendToContext(state);
                            expAdj--;
                            switch (state.current) {
                                case '1':
                                case '2':
                                case '3':
                                case '4':
                                case '5':
                                case '6':
                                case '7':
                                case '8':
                                case '9':
                                    break l;
                                default:
                                    if (!mantRead) {
                                        return state;
                                    }
                                    break m2;
                                case '0':
                            }
                        }
                    }
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                    l: for (;;) {
                        if (mantDig < 9) {
                            mantDig++;
                            mant = mant * 10 + (state.current - '0');
                            expAdj--;
                        }
                        state.current = state.reader.read();
                        state = appendToContext(state);
                        switch (state.current) {
                            default:
                                break l;
                            case '0':
                            case '1':
                            case '2':
                            case '3':
                            case '4':
                            case '5':
                            case '6':
                            case '7':
                            case '8':
                            case '9':
                        }
                    }
            }
        }

        switch (state.current) {
            case 'e':
            case 'E':
                state.current = state.reader.read();
                state = appendToContext(state);
                switch (state.current) {
                    default:
                        reportNonNumber(command, state.current, state.context);
                        return state;
                    case '-':
                        expPos = false;
                    case '+':
                        state.current = state.reader.read();
                        state = appendToContext(state);
                        switch (state.current) {
                            default:
                                reportNonNumber(command, state.current,
                                        state.context);
                                return state;
                            case '0':
                            case '1':
                            case '2':
                            case '3':
                            case '4':
                            case '5':
                            case '6':
                            case '7':
                            case '8':
                            case '9':
                        }
                    case '0':
                    case '1':
                    case '2':
                    case '3':
                    case '4':
                    case '5':
                    case '6':
                    case '7':
                    case '8':
                    case '9':
                }

                en: switch (state.current) {
                    case '0':
                        l: for (;;) {
                            state.current = state.reader.read();
                            state = appendToContext(state);
                            switch (state.current) {
                                case '1':
                                case '2':
                                case '3':
                                case '4':
                                case '5':
                                case '6':
                                case '7':
                                case '8':
                                case '9':
                                    break l;
                                default:
                                    break en;
                                case '0':
                            }
                        }

                    case '1':
                    case '2':
                    case '3':
                    case '4':
                    case '5':
                    case '6':
                    case '7':
                    case '8':
                    case '9':
                        l: for (;;) {
                            if (expDig < 3) {
                                expDig++;
                                exp = exp * 10 + (state.current - '0');
                            }
                            state.current = state.reader.read();
                            state = appendToContext(state);
                            switch (state.current) {
                                default:
                                    break l;
                                case '0':
                                case '1':
                                case '2':
                                case '3':
                                case '4':
                                case '5':
                                case '6':
                                case '7':
                                case '8':
                                case '9':
                            }
                        }
                }
            default:
        }

        if (!expPos) {
            exp = -exp;
        }
        exp += expAdj;
        if (!mantPos) {
            mant = -mant;
        }
        return state;
    }
1036774
private function scanRolesAndPermissions()
    {
        $files = $this->getConfigFiles();

        if( ! empty($files) )
            foreach ( $files as $filePath ) {
                $config = json_decode(file_get_contents($filePath), true);

                if( is_null($config) )
                    $this->info('Invalid json file: ' . $filePath);
                else {
                    $packageName = array_get($config, 'general.serviceProviderNameSpace');

                    if( is_null($packageName) || $packageName == '' ) {
                        $this->error('SKIPPING! Package must have a name! file: ' . $filePath);
                        continue;
                    }

                    if( array_key_exists('acl', $config) ) {
                        $this->aclData[] = [
                            'packageName' => $packageName,
                            'acl'         => array_get($config, 'acl'),
                        ];
                    }
                }
            }
    }
6425
function checkout (cb) {
    if (my.args.length !== 1) {
      return cb( erf( '"checkout" command requires single <bin> argument' ) )
    }
    var bin
    , found = false
    , chbin = my.args[0]

    for (bin in my.state.bins) {
      if (path.basename(bin) === path.basename(chbin)) {
        my.state.bins = setActiveBin(my.state.bins, bin)
        found = true
      }
    }
    if (!found) {
      return cb( erf( 'Can not checkout ' +  path.basename(chbin)
                      + '. Bin not recognized'))
    }
    cb(null, my.state)
  }
372726
private void checkPolicy(X509Certificate currCert)
        throws CertPathValidatorException
    {
        String msg = "certificate policies";
        if (debug != null) {
            debug.println("PolicyChecker.checkPolicy() ---checking " + msg
                + "...");
            debug.println("PolicyChecker.checkPolicy() certIndex = "
                + certIndex);
            debug.println("PolicyChecker.checkPolicy() BEFORE PROCESSING: "
                + "explicitPolicy = " + explicitPolicy);
            debug.println("PolicyChecker.checkPolicy() BEFORE PROCESSING: "
                + "policyMapping = " + policyMapping);
            debug.println("PolicyChecker.checkPolicy() BEFORE PROCESSING: "
                + "inhibitAnyPolicy = " + inhibitAnyPolicy);
            debug.println("PolicyChecker.checkPolicy() BEFORE PROCESSING: "
                + "policyTree = " + rootNode);
        }

        X509CertImpl currCertImpl = null;
        try {
            currCertImpl = X509CertImpl.toImpl(currCert);
        } catch (CertificateException ce) {
            throw new CertPathValidatorException(ce);
        }

        boolean finalCert = (certIndex == certPathLen);

        rootNode = processPolicies(certIndex, initPolicies, explicitPolicy,
            policyMapping, inhibitAnyPolicy, rejectPolicyQualifiers, rootNode,
            currCertImpl, finalCert);

        if (!finalCert) {
            explicitPolicy = mergeExplicitPolicy(explicitPolicy, currCertImpl,
                                                 finalCert);
            policyMapping = mergePolicyMapping(policyMapping, currCertImpl);
            inhibitAnyPolicy = mergeInhibitAnyPolicy(inhibitAnyPolicy,
                                                     currCertImpl);
        }

        certIndex++;

        if (debug != null) {
            debug.println("PolicyChecker.checkPolicy() AFTER PROCESSING: "
                + "explicitPolicy = " + explicitPolicy);
            debug.println("PolicyChecker.checkPolicy() AFTER PROCESSING: "
                + "policyMapping = " + policyMapping);
            debug.println("PolicyChecker.checkPolicy() AFTER PROCESSING: "
                + "inhibitAnyPolicy = " + inhibitAnyPolicy);
            debug.println("PolicyChecker.checkPolicy() AFTER PROCESSING: "
                + "policyTree = " + rootNode);
            debug.println("PolicyChecker.checkPolicy() " + msg + " verified");
        }
    }
337035
static void checkAccess(final int access, final int possibleAccess) {
        if ((access & ~possibleAccess) != 0) {
            throw new IllegalArgumentException("Invalid access flags: "
                    + access);
        }
        int pub = (access & Opcodes.ACC_PUBLIC) == 0 ? 0 : 1;
        int pri = (access & Opcodes.ACC_PRIVATE) == 0 ? 0 : 1;
        int pro = (access & Opcodes.ACC_PROTECTED) == 0 ? 0 : 1;
        if (pub + pri + pro > 1) {
            throw new IllegalArgumentException(
                    "public private and protected are mutually exclusive: "
                            + access);
        }
        int fin = (access & Opcodes.ACC_FINAL) == 0 ? 0 : 1;
        int abs = (access & Opcodes.ACC_ABSTRACT) == 0 ? 0 : 1;
        if (fin + abs > 1) {
            throw new IllegalArgumentException(
                    "final and abstract are mutually exclusive: " + access);
        }
    }
494410
func Usage(r *RootCMD, c *CMD) {
	translate.Printf("SUBCOMMAND USAGE", r.Name, c.Name)
	t := reflect.TypeOf(c.Args).Elem()
	max := 0
	for i := 0; i < t.NumField(); i++ {
		name := t.Field(i).Name
		fmt.Printf(" <%s>", name)
		if len(name) > max {
			max = len(name)
		}
	}
	print("\n\n")
	translate.Printf("DESCRIPTION", c.Short)
	print("\n\n")
	if t.NumField() > 0 {
		translate.Printf("ARGUMENTS")
		print("\n\n")
		for i := 0; i < t.NumField(); i++ {
			fmt.Printf("%"+strconv.Itoa(max+4)+"s : %s\n", t.Field(i).Name, t.Field(i).Tag.Get("desc"))
		}
		print("\n")
	}
	if r.Flags != nil {
		translate.Printf("GLOBAL FLAGS")
		print("\n\n")
		PrintFlags(r.Flags)
	}
}
586754
def mod_run_check_cmd(cmd, filename, **check_cmd_opts):
    '''
    
    '''

    log.debug('running our check_cmd')
    _cmd = '{0} {1}'.format(cmd, filename)
    cret = __salt__['cmd.run_all'](_cmd, **check_cmd_opts)
    if cret['retcode'] != 0:
        ret = {'comment': 'check_cmd execution failed',
               'skip_watch': True,
               'result': False}

        if cret.get('stdout'):
            ret['comment'] += '\n' + cret['stdout']
        if cret.get('stderr'):
            ret['comment'] += '\n' + cret['stderr']

        return ret

    # No reason to stop, return True
    return True
1238990
function parseGruntCommandLine() {
        var cmdline = _cmdline.match(/--[\S]+\b/ig);

        if (null != cmdline) {
            for (var i = 0, n = cmdline.length; i < n; i++) {
                // if cmdline does not have "=", set "true" as default value.
                if (!cmdline[i].match(/=/i)) {
                    cmdline[i] += '=true';
                }
            }
        } else {
            cmdline = [];
        }

        return cmdline;
    }
37383
function acl_autocomplete()
    {
        $this->load_config();

        $search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true);
        $reqid  = rcube_utils::get_input_value('_reqid', rcube_utils::INPUT_GPC);
        $users  = array();
        $keys   = array();

        if ($this->init_ldap()) {
            $max  = (int) $this->rc->config->get('autocomplete_max', 15);
            $mode = (int) $this->rc->config->get('addressbook_search_mode');

            $this->ldap->set_pagesize($max);
            $result = $this->ldap->search('*', $search, $mode);

            foreach ($result->records as $record) {
                $user = $record['uid'];

                if (is_array($user)) {
                    $user = array_filter($user);
                    $user = $user[0];
                }

                if ($user) {
                    $display = rcube_addressbook::compose_search_name($record);
                    $user    = array('name' => $user, 'display' => $display);
                    $users[] = $user;
                    $keys[]  = $display ?: $user['name'];
                }
            }

            if ($this->rc->config->get('acl_groups')) {
                $prefix      = $this->rc->config->get('acl_group_prefix');
                $group_field = $this->rc->config->get('acl_group_field', 'name');
                $result      = $this->ldap->list_groups($search, $mode);

                foreach ($result as $record) {
                    $group    = $record['name'];
                    $group_id = is_array($record[$group_field]) ? $record[$group_field][0] : $record[$group_field];

                    if ($group) {
                        $users[] = array('name' => ($prefix ?: '') . $group_id, 'display' => $group, 'type' => 'group');
                        $keys[]  = $group;
                    }
                }
            }
        }

        if (count($users)) {
            // sort users index
            asort($keys, SORT_LOCALE_STRING);
            // re-sort users according to index
            foreach ($keys as $idx => $val) {
                $keys[$idx] = $users[$idx];
            }
            $users = array_values($keys);
        }

        $this->rc->output->command('ksearch_query_results', $users, $search, $reqid);
        $this->rc->output->send();
    }
4666
function parseHealthcheck(cmd) {
    var words = parseWords(cmd.rest),
        cmdDirectiveIndex = words.indexOf("CMD"),        
        noneDirectiveIndex = words.indexOf("NONE");

    if (cmdDirectiveIndex === -1 && noneDirectiveIndex === -1) {
        cmd.error = 'A HEALTHCHECK instruction must specify either NONE, or a valid CMD and options';
        return false;
    } else if (cmdDirectiveIndex !== -1) {
        // Reject a CMD directive that doesn't preceed an actual command.
        if (cmdDirectiveIndex === words.length - 1) {
            cmd.error = 'A CMD directive must specify a command for the healthcheck to run';
            return false;
        }
        
        cmd.args = { command: words.slice(cmdDirectiveIndex + 1).join(" ") };

        if (cmdDirectiveIndex > 0) {
            // There are options specified, so let's verify they're valid.
            var cmdDirectiveOptions = words.slice(0, cmdDirectiveIndex),
                validCmdOptions = ["interval", "retries", "timeout", "start-period"];

            for (var i = 0; i < cmdDirectiveOptions.length; i++) {
                var match = /--([a-zA-Z0-9_-]+)=(\d+)/.exec(cmdDirectiveOptions[i]);
                if (!match) {
                    cmd.error = '"' + cmdDirectiveOptions[i] + '" isn\'t a syntactically valid CMD option';
                    return false;
                } else if (validCmdOptions.indexOf(match[1]) === -1) {
                    cmd.error = '"' + match[1] + '" isn\'t a valid CMD option';
                    return false;
                }

                cmd.args[match[1]] = match[2];
            }
        }
    } else if (noneDirectiveIndex !== -1) {
        if (words.length > 1) {
            cmd.error = 'The NONE directive doesn\'t support additional options';
            return false;
        }

        cmd.args = { isNone: true };
    }

    return true;
}
223128
def _check_acl(self, acl_no, network, netmask):
        
        exp_cfg_lines = ['ip access-list standard ' + str(acl_no),
                         ' permit ' + str(network) + ' ' + str(netmask)]
        ios_cfg = self._get_running_config()
        parse = HTParser(ios_cfg)
        acls_raw = parse.find_children(exp_cfg_lines[0])
        if acls_raw:
            if exp_cfg_lines[1] in acls_raw:
                return True
            LOG.error("Mismatch in ACL configuration for %s", acl_no)
            return False
        LOG.debug("%s is not present in config", acl_no)
        return False
898061
private void checkACL(String path, int perm) throws KeeperException.NoAuthException {
        DataAndVersion node = _data.get(path);
        if (node == null) {
            return;
        }
        List<ACL> acl = node.getAcl();
        if (acl == null || acl.size() == 0) {
            return;
        }
        for (Id authId : _ids) {
            if (authId.getScheme().equals("super")) {
                return;
            }
        }
        for (ACL a : acl) {
            Id id = a.getId();
            if ((a.getPerms() & perm) != 0) {
                if (id.getScheme().equals("world") && id.getId().equals("anyone")) {
                    return;
                }
                for (Id authId : _ids) {
                    if (authId.getScheme().equals(id.getScheme()) && authId.getId().equals(id.getId())) {
                        return;
                    }
                }
            }
        }
        throw new KeeperException.NoAuthException();
    }
1176381
func (c *Config) CheckACL() error {
	switch c.ACLDefaultPolicy {
	case "allow":
	case "deny":
	default:
		return fmt.Errorf("Unsupported default ACL policy: %s", c.ACLDefaultPolicy)
	}
	switch c.ACLDownPolicy {
	case "allow":
	case "deny":
	case "async-cache", "extend-cache":
	default:
		return fmt.Errorf("Unsupported down ACL policy: %s", c.ACLDownPolicy)
	}
	return nil
}
108052
function executeFindCommand(bson, ns, cmd, cursorState, topology, options) {
  // Ensure we have at least some options
  options = options || {};
  // Get the readPreference
  const readPreference = getReadPreference(cmd, options);

  // Set the optional batchSize
  cursorState.batchSize = cmd.batchSize || cursorState.batchSize;

  // Build command namespace
  const parts = ns.split(/\./);
  // Command namespace
  const commandns = `${parts.shift()}.$cmd`;

  // Build actual find command
  let findCmd = {
    find: parts.join('.')
  };

  // I we provided a filter
  if (cmd.query) {
    // Check if the user is passing in the $query parameter
    if (cmd.query['$query']) {
      findCmd.filter = cmd.query['$query'];
    } else {
      findCmd.filter = cmd.query;
    }
  }

  // Sort value
  let sortValue = cmd.sort;

  // Handle issue of sort being an Array
  if (Array.isArray(sortValue)) {
    const sortObject = {};

    if (sortValue.length > 0 && !Array.isArray(sortValue[0])) {
      let sortDirection = sortValue[1];
      // Translate the sort order text
      if (sortDirection === 'asc') {
        sortDirection = 1;
      } else if (sortDirection === 'desc') {
        sortDirection = -1;
      }

      // Set the sort order
      sortObject[sortValue[0]] = sortDirection;
    } else {
      for (var i = 0; i < sortValue.length; i++) {
        let sortDirection = sortValue[i][1];
        // Translate the sort order text
        if (sortDirection === 'asc') {
          sortDirection = 1;
        } else if (sortDirection === 'desc') {
          sortDirection = -1;
        }

        // Set the sort order
        sortObject[sortValue[i][0]] = sortDirection;
      }
    }

    sortValue = sortObject;
  }

  // Add sort to command
  if (cmd.sort) findCmd.sort = sortValue;
  // Add a projection to the command
  if (cmd.fields) findCmd.projection = cmd.fields;
  // Add a hint to the command
  if (cmd.hint) findCmd.hint = cmd.hint;
  // Add a skip
  if (cmd.skip) findCmd.skip = cmd.skip;
  // Add a limit
  if (cmd.limit) findCmd.limit = cmd.limit;

  // Check if we wish to have a singleBatch
  if (cmd.limit < 0) {
    findCmd.limit = Math.abs(cmd.limit);
    findCmd.singleBatch = true;
  }

  // Add a batchSize
  if (typeof cmd.batchSize === 'number') {
    if (cmd.batchSize < 0) {
      if (cmd.limit !== 0 && Math.abs(cmd.batchSize) < Math.abs(cmd.limit)) {
        findCmd.limit = Math.abs(cmd.batchSize);
      }

      findCmd.singleBatch = true;
    }

    findCmd.batchSize = Math.abs(cmd.batchSize);
  }

  // If we have comment set
  if (cmd.comment) findCmd.comment = cmd.comment;

  // If we have maxScan
  if (cmd.maxScan) findCmd.maxScan = cmd.maxScan;

  // If we have maxTimeMS set
  if (cmd.maxTimeMS) findCmd.maxTimeMS = cmd.maxTimeMS;

  // If we have min
  if (cmd.min) findCmd.min = cmd.min;

  // If we have max
  if (cmd.max) findCmd.max = cmd.max;

  // If we have returnKey set
  findCmd.returnKey = cmd.returnKey ? cmd.returnKey : false;

  // If we have showDiskLoc set
  findCmd.showRecordId = cmd.showDiskLoc ? cmd.showDiskLoc : false;

  // If we have snapshot set
  if (cmd.snapshot) findCmd.snapshot = cmd.snapshot;

  // If we have tailable set
  if (cmd.tailable) findCmd.tailable = cmd.tailable;

  // If we have oplogReplay set
  if (cmd.oplogReplay) findCmd.oplogReplay = cmd.oplogReplay;

  // If we have noCursorTimeout set
  if (cmd.noCursorTimeout) findCmd.noCursorTimeout = cmd.noCursorTimeout;

  // If we have awaitData set
  if (cmd.awaitData) findCmd.awaitData = cmd.awaitData;
  if (cmd.awaitdata) findCmd.awaitData = cmd.awaitdata;

  // If we have partial set
  if (cmd.partial) findCmd.partial = cmd.partial;

  // If we have collation passed in
  if (cmd.collation) findCmd.collation = cmd.collation;

  // If we have explain, we need to rewrite the find command
  // to wrap it in the explain command
  if (cmd.explain) {
    findCmd = {
      explain: findCmd
    };
  }

  // Did we provide a readConcern
  if (cmd.readConcern) findCmd.readConcern = cmd.readConcern;

  // Set up the serialize and ignoreUndefined fields
  const serializeFunctions =
    typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  const ignoreUndefined =
    typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false;

  // We have a Mongos topology, check if we need to add a readPreference
  if (topology.type === 'mongos' && readPreference && readPreference.preference !== 'primary') {
    findCmd = {
      $query: findCmd,
      $readPreference: readPreference.toJSON()
    };
  }

  // optionally decorate query with transaction data
  const err = decorateWithSessionsData(findCmd, options.session, options);
  if (err) {
    return err;
  }

  // Build Query object
  const query = new Query(bson, commandns, findCmd, {
    numberToSkip: 0,
    numberToReturn: 1,
    checkKeys: false,
    returnFieldSelector: null,
    serializeFunctions: serializeFunctions,
    ignoreUndefined: ignoreUndefined
  });

  // Set query flags
  query.slaveOk = readPreference.slaveOk();

  // Return the query
  return query;
}
833707
def space_set_acl(args):
    
    acl_updates = [{"email": user,
                   "accessLevel": args.role} for user in args.users]
    r = fapi.update_workspace_acl(args.project, args.workspace, acl_updates)
    fapi._check_response_code(r, 200)
    errors = r.json()['usersNotFound']

    if len(errors):
        eprint("Unable to assign role for unrecognized users:")
        for user in errors:
            eprint("\t{0}".format(user['email']))
        return 1

    if fcconfig.verbosity:
        print("Successfully updated {0} role(s)".format(len(acl_updates)))

    return 0