Whether an action is defined on a resource on the version.
 @param resource [Symbol] The resource's name
 @param action [Symbol] The action's name
 @return [Boolean]
343162
def action?(resource, action)
      resource = resource.to_sym
      action = action.to_sym

      return false unless resource?(resource)

      _resources.find(resource).actions.names.include? action
    end
473006
def action=(action)
      if !VALID_ACTIONS.include?(action.to_s.upcase)
        raise ArgumentError, "Action must be one of #{VALID_ACTIONS.join(', ')}"
      end
      @action = action.downcase.to_sym
    end
999629
public function can($action, $resource = null, $resourceId = null)
    {
        $actions = (array) $action;
        $resource = $this->convertResourceToObject($resource, $resourceId);
        $permissions = $this->getPermissions();

        foreach ($actions as $action) {
            if ($aliases = $this->getAliasesForAction($action)) {
                if ($this->can($aliases, $resource) && $this->resolveRestrictions($permissions, $action, $resource)) {
                    return true;
                }
            }

            if (! $this->resolvePermissions($action, $resource)) {
                return false;
            }
        }

        return true;
    }
1184340
def action_is_satisfied(action):
    ''' 
    '''
    num_consumed_args = getattr(action, 'num_consumed_args', 0)

    if action.nargs == ONE_OR_MORE and num_consumed_args < 1:
        return False
    else:
        if action.nargs is None:
            action.nargs = 1
        try:
            return num_consumed_args == action.nargs
        except:
            return True
560762
public boolean checkResource(RequiredOrientResource resource, Action action)
	{
		if(!resource.action().equals(action.getName())) return true;
		OSecurityUser user = OrientDbWebSession.get().getEffectiveUser();
		if(user==null) return false;
		int iOperation = OrientPermission.combinedPermission(resource.permissions());
		ORule.ResourceGeneric value = OSecurityHelper.getResourceGeneric(resource.value());
		String specific = resource.specific();
		if(Strings.isEmpty(specific)) specific = null;
		if(user.checkIfAllowed(value, specific, iOperation)!=null) return true;
		while(!Strings.isEmpty(specific=Strings.beforeLastPathComponent(specific, '.')))
		{
			if(user.checkIfAllowed(value, specific+"."+ODatabaseSecurityResources.ALL, iOperation)!=null) return true;
		}
		return false;
	}
557578
public boolean hasDelfoiAccess(User user, DelfoiActionName actionName) {
    if (isSuperUser(user)) {
      return true;
    }
    
    DelfoiAction action = delfoiActionDAO.findByActionName(actionName.toString());
    if (action == null) {
      logger.info(String.format("ActionUtils.hasDelfoiAccess - undefined action: '%s'", actionName));
      return false;
    }
    
    UserRole userRole = getDelfoiRole(user);
    return hasDelfoiAccess(action, userRole);
  }
674875
def requested_by?(resource)
      user = resource.respond_to?(:owner) ? resource.owner : resource
      case
      when current_resource_owner.nil?
        false
      when !user.is_a?(current_resource_owner.class)
        false
      when current_resource_owner.id == user.id
        true
      else
        false
      end
    end
1326718
public static boolean isValid(Resource resource) {
        return resource instanceof ResourceHandle
                ? ((ResourceHandle) resource).isValid()
                : resource != null && resource.getResourceResolver().getResource(resource.getPath()) != null;
    }
184060
public function isExportFileAction($resource, $action)
    {
        return isset($this->exportFileActions[$resource]) && in_array($action, $this->exportFileActions[$resource]);
    }
1110646
private boolean isUpload(String action) {
		if (StringUtils.hasText(action) && action.equals(OperationType.UPLOAD.toString())) {
			return true;
		}
		return false;
	}
406634
def method_missing(name, *args, &block)
      if @resource.respond_to?(name)
        result = @resource.send(name, *args, &block)
        result.is_a?(Resource) ? ResourceAndAddress.new(result, @address.dup) : result
      else
        super
      end
    end
642479
def find_resource(id = nil)
      id ||= respond_to?(:params) && params.is_a?(ActionController::Parameters) && params[:id]
      resource_service.find id
    end
979634
public static boolean isGrailsResource(Resource r) {
        try {
            String file = r.getURL().getFile();
            return isGrailsPath(file) || file.endsWith("GrailsPlugin.groovy");
        }
        catch (IOException e) {
            return false;
        }
    }
284796
@Override
    public boolean validateAction(String action) {
        boolean result = false;
        if (action.equals(MessagingSecurityConstants.OPERATION_TYPE_SEND) ||
            action.equals(MessagingSecurityConstants.OPERATION_TYPE_RECEIVE)) {
            result = true;
        }
        return result;
    }
900302
def resource_changed?(resource, response)
      changed = false
      puts "checking for changes on #{resource.url}"
      puts "response.response.hash: #{response.response.hash}"
      puts "resource.last_modified_hash: #{resource.last_modified_hash}"
      if response.response.hash != resource.last_modified_hash
        puts "changed!!!!\n\n\n\n"
        changed = true
      end
    end
1172225
def same_resource?(resource_a, resource_b)
      resource_a.namespace == resource_b.namespace &&
        resource_a.apiVersion == resource_b.apiVersion &&
        resource_a.kind == resource_b.kind &&
        resource_a.metadata[:name] == resource_b.metadata[:name]
    end
393737
protected boolean mappingActionPath(MappingPathResource pathResource, ActionFoundPathHandler handler) throws Exception {
        final String mappingPath = pathResource.getMappingPath();
        final String[] names = LdiStringUtil.split(mappingPath, URL_DELIMITER); // e.g. [sea, land] if /sea/land/
        final LaContainer root = container.getRoot(); // because actions are in root
        final String rootAction = buildActionName(pathResource, null, "root");
        if (names.length == 0) { // root action, / => rootAction
            if (hasActionDef(root, rootAction)) {
                if (executeHandlerIfFound(pathResource, handler, rootAction, null)) {
                    return true;
                }
            }
        }
        StringBuilder prefixSb = null; // lazy loaded, "" => sea => seaLand
        List<String> previousList = null; // lazy loaded, (empty) => [sea] => [sea, land]
        for (int index = 0; index < names.length; index++) {
            final String currentName = names[index];
            if (containsNotAllowedCharacterAsActionPath(currentName)) { // e.g. /Sea/land/, /sea/Land/
                return false; // cannot use upper case in action path (while, allowed in param path)
            }
            final int nextIndex = index + 1;
            if (index == 0) { // first loop
                // /sea/ => seaAction
                final String directAction = buildActionName(pathResource, null, currentName);
                if (hasActionDef(root, directAction)) {
                    if (executeHandlerIfFound(pathResource, handler, directAction, buildParamPath(names, nextIndex))) {
                        return true;
                    }
                }
                // /sea/ => sea_seaAction
                final String wholePkgAction = buildActionName(pathResource, currentName + "_", currentName);
                if (hasActionDef(root, wholePkgAction)) {
                    if (executeHandlerIfFound(pathResource, handler, wholePkgAction, buildParamPath(names, nextIndex))) {
                        return true;
                    }
                }
            } else { // second or more loop
                // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
                // e.g. process of outer and nested loop
                // 
                // second : /sea/land/
                //   first  : seaLandAction
                //   more   : sea_seaLandAction
                //   whole  : sea_land_seaLandAction
                // 
                // third : /sea/land/piari/
                //   first  : seaLandPiariAction
                //   second : sea_seaLandPiariAction
                //   more   : sea_land_seaLandPiariAction
                //   whole  : sea_land_piari_seaLandPiariAction
                // 
                // fourth : /sea/land/piari/bonvo
                //   first  : seaLandPiariBonvoAction
                //   second : sea_seaLandPiariBonvoAction
                //   third  : sea_land_seaLandPiariBonvoAction
                //   more   : sea_land_piari_seaLandPiariBonvoAction
                //   whole  : sea_land_piari_bonvo_seaLandPiariBonvoAction
                // _/_/_/_/_/_/_/_/_/_/
                final String classPrefix = prefixSb.toString() + initCap(currentName); // seaLand, seaLandPiari
                StringBuilder pkgSb = null; // lazy loaded
                for (String previous : previousList) { // always one or more loop
                    final String actionName = buildActionName(pathResource, pkgSb != null ? pkgSb.toString() : null, classPrefix);
                    if (hasActionDef(root, actionName)) {
                        if (executeHandlerIfFound(pathResource, handler, actionName, buildParamPath(names, nextIndex))) {
                            return true;
                        }
                    }
                    pkgSb = pkgSb != null ? pkgSb : new StringBuilder(mappingPath.length());
                    pkgSb.append(previous).append("_");
                }
                final String morePkgActionName = buildActionName(pathResource, pkgSb.toString(), classPrefix);
                if (hasActionDef(root, morePkgActionName)) {
                    if (executeHandlerIfFound(pathResource, handler, morePkgActionName, buildParamPath(names, nextIndex))) {
                        return true;
                    }
                }
                pkgSb.append(currentName).append("_"); // sea_land_, sea_land_piari_, ...
                final String wholePkgActionName = buildActionName(pathResource, pkgSb.toString(), classPrefix);
                if (hasActionDef(root, wholePkgActionName)) {
                    if (executeHandlerIfFound(pathResource, handler, wholePkgActionName, buildParamPath(names, nextIndex))) {
                        return true;
                    }
                }
            }
            prefixSb = prefixSb != null ? prefixSb : new StringBuilder(mappingPath.length());
            prefixSb.append(index == 0 ? currentName : initCap(currentName));
            previousList = previousList != null ? previousList : new ArrayList<String>(4);
            previousList.add(currentName);
        }
        if (names.length > 0) { // e.g. /sea/land but not found except root action
            // only root action's named methods are low priority (to avoid searching cost)
            if (hasActionDef(root, rootAction)) {
                if (executeHandlerIfFound(pathResource, handler, rootAction, buildParamPath(names, 0))) {
                    return true;
                }
            }
        }
        return false;
    }