Validate that all entries in the supervisor are valid task configurations and
        that all permissions requirements are satisfied.
505089
def validate_monitor_tasks(dependencies, args):
    
    # Make a list of all task configurations needed to supervise
    sup_configs = sorted(dependencies.keys())


    try:
        logging.info("Validating supervisor data...")
        # Make an api call to list task configurations in the workspace
        r = fapi.list_workspace_configs(args['project'], args['workspace'])
        fapi._check_response_code(r, 200)
        space_configs = r.json()

        # Make a dict for easy lookup later
        space_configs = { c["name"]: c for c in space_configs}

        # Also make an api call to list methods you have view permissions for
        r = fapi.list_repository_methods()
        fapi._check_response_code(r, 200)
        repo_methods = r.json()

        ## Put in a form that is more easily searchable: namespace/name:snapshot
        repo_methods = {m['namespace'] + '/' + m['name'] + ':' + str(m['snapshotId'])
                        for m in repo_methods if m['entityType'] == 'Workflow'}

        valid = True

        for config in sup_configs:
            # ensure config exists in the workspace
            if config not in space_configs:
                logging.error("No task configuration for "
                              + config + " found in " + args['project'] + "/"
                              + args['workspace'])
                valid = False
            else:
                # Check access permissions for the referenced method
                m = space_configs[config]['methodRepoMethod']
                ref_method = m['methodNamespace'] + "/" + m['methodName'] + ":" + str(m['methodVersion'])
                if ref_method not in repo_methods:
                    logging.error(config+ " -- You don't have permisson to run the referenced method: "
                                  + ref_method)
                    valid = False

    except Exception as e:
        logging.error("Exception occurred while validating supervisor: " + str(e))
        raise
        return False

    return valid
736075
def approveworker(ctx, workers, account):
    
    print_tx(ctx.bitshares.approveworker(workers, account=account))
49833
def verify_valid_dependencies(self):
        

        unobserved_dependencies = set(self.tasks.keys())
        target_queue = []

        while len(unobserved_dependencies) > 0:
            target_queue = [unobserved_dependencies.pop()]

            while target_queue is not []:
                target_queue += unobserved_dependencies
1169452
def perform_permissions_check(self, user, obj, perms):
        
        return self.request.forum_permission_handler.can_approve_posts(obj, user)
1019612
private Set<Permission> checkPermissions(AAFAuthenticatedUser aau, LocalPermission perm) {
    	if(localLur.fish(aau.getFullName(), perm)) {
//        	aau.setSuper(true);
        	return Permission.ALL;
    	} else {
    		return Permission.NONE;
    	}
    }
793049
def validate(config, log):
    
    if config['always_job_dirs'] and config['no_job_dirs']:
        log.error('Contradiction: --always-job-dirs and --no-job-dirs used.')
        raise HandledError
    if config['commit'] and not REGEX_COMMIT.match(config['commit']):
        log.error('No or invalid git commit obtained.')
        raise HandledError
    if config['dir'] and not os.path.isdir(config['dir']):
        log.error("Not a directory or doesn't exist: %s", config['dir'])
        raise HandledError
    if config['no_job_dirs'] not in ('', 'rename', 'overwrite', 'skip'):
        log.error('--no-job-dirs has invalid value. Check --help for valid values.')
        raise HandledError
    if not config['owner'] or not REGEX_GENERAL.match(config['owner']):
        log.error('No or invalid repo owner name obtained.')
        raise HandledError
    if config['pull_request'] and not config['pull_request'].isdigit():
        log.error('--pull-request is not a digit.')
        raise HandledError
    if not config['repo'] or not REGEX_GENERAL.match(config['repo']):
        log.error('No or invalid repo name obtained.')
        raise HandledError
    if config['tag'] and not REGEX_GENERAL.match(config['tag']):
        log.error('Invalid git tag obtained.')
        raise HandledError
328372
def is_valid(self):
        """"""
        if not self.total:
            return False
        if not self.contributor.freelanceprofile.is_freelance:
            return False
        return True
1026327
def has_permission(self, request):
        
        if not super(AdminSiteOTPRequiredMixin, self).has_permission(request):
            return False
        return request.user.is_verified()
875322
def work
      success, val, reason = SafeTaskExecutor.new(@task).execute(*@args)
      complete(success, val, reason)
    end
493571
public function verifySettings()
    {
        if ($this->targetdir === null) {
            $this->setError("The targetdir attribute is required.");
        }
        if ($this->mapperElement === null) {
            $this->map = new IdentityMapper();
        } else {
            $this->map = $this->mapperElement->getImplementation();
        }
        if ($this->map === null) {
            $this->setError("Could not set <mapper> element.");
        }
    }
52299
public function valid()
    {
        if (null === $this->getManagerName()) {
            $errMsg = 'No workflow manager';
            throw new Exception\InvalidArgumentException($errMsg);
        }

        if (null === $this->getActionName()) {
            $errMsg = 'Not Specified action for workflow';
            throw new Exception\InvalidArgumentException($errMsg);
        }

        $workflowActivity = $this->getRunType();
        if (!array_key_exists($workflowActivity, $this->allowWorkflowRunType)) {
            $errMsg = sprintf('Invalid activity %s', $workflowActivity);
            throw new Exception\InvalidArgumentException($errMsg);
        }

        if (static::WORKFLOW_RUN_INITIALIZE === $workflowActivity && null === $this->getWorkflowName()) {
            $errMsg = 'Not specified name workflow';
            throw new Exception\InvalidArgumentException($errMsg);
        }

        if (static::WORKFLOW_RUN_TYPE_DO_ACTION === $workflowActivity && null === $this->getEntryId()) {
            $errMsg = 'Not specified entryId';
            throw new Exception\InvalidArgumentException($errMsg);
        }
    }
199007
function verifyTasks() {
      if ( options.tasks.build ) {
        if ( isTypeString(options.tasks.build) ) {
          options.tasks.build = [options.tasks.build];
        }
        if ( util.isArray(options.tasks.build) ) {
          options.tasks.build.forEach(function( item ) {
            if ( !isTypeString(item) ) {
              errorOption('tasks.build', JSON.stringify(item));
            }
          });
        }
        else {
          errorOption('tasks.build', options.tasks.build);
        }
      }
      else {
        options.tasks.build = [];
      }
    }
1252011
def validate(self):
        """"""
        if not self._resource.get('permissions'):
            self.permissions = self.default_permissions

        try:
            # update _resource so have default values from the schema
            self._resource = self.schema(self._resource)
        except MultipleInvalid as e:
            errors = [format_error(err, self.resource_type) for err in e.errors]
            raise exceptions.ValidationError({'errors': errors})

        yield self.check_service()
        yield self.check_unique()
1069894
public static function validate()
    {
        if (isset(self::core()->valid)) {
            return self::core()->valid;
        }

        //====================================================================//
        // Initialize Tasks List
        self::core()->valid = new Validator();

        //====================================================================//
        //  Load Translation File
        self::translator()->load('ws');
        self::translator()->load('validate');

        return self::core()->valid;
    }
1249784
def approve_task(self, task_id):
        
        uri = 'tasks/%s' % task_id

        data = {"approved": True}

        resp, body = self.post(uri, json.dumps(data))
        self.expected_success(200, resp.status)
        body = json.loads(body)
        return rest_client.ResponseBody(resp, body)
889043
def validate_credentials!
      fail(
        DeskApi::Error::ConfigurationError, 'Invalid credentials: ' \
        'Either username/password or OAuth credentials must be specified.'
      ) unless credentials?

      validate_oauth! if oauth.values.all?
      validate_basic_auth! if basic_auth.values.all?
    end
191963
def verify(ctx):
    """"""
    oks = run_configurations(
        skipper(verify_environments),
        read_sections,
    )
    ctx.exit(0
             if False not in oks
             else 1)