@param null|string|false $capability

@return bool
505374
public function user_can( $capability = null ) {
		if ( ! isset( $capability ) ) {
			$capability = $this->app->get_config( 'capability', 'default_user', 'manage_options' );
		}
		if ( false === $capability ) {
			return true;
		}
		if ( '' === $capability ) {
			return false;
		}

		return $this->has_cap( $capability ) || in_array( $capability, $this->user_roles );
	}
693908
public function isDelete($allowDelete = null)
    {
        if (null !== $allowDelete) {
            $this->allowDelete = $allowDelete;
        }

        return $this->allowDelete;
    }
207613
public function hasLink( $link, &$linkDetail = null )
    {

        $links = $this->__get('links');

        if( isset($links[$link])) {
            $linkDetail = $links[$link];
            return $link;
        }

        foreach( $links as $via => $linkDetail ){
            if( in_array( $link, $linkDetail->foreignEntities ) ) {
                return $via;
            }
        }

        return false;

    }
1288860
public function check_capabilities() {
		if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
			return false;
		}

		if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
			return false;
		}

		return true;
	}
432029
public function can($permission, $allowAny = false)
    {
        if ( ! ($user = $this->user())) {
            return false;
        }

        if ($user->isAdmin()) {
            return true;
        }

        return $user->can($permission, $allowAny);
    }
78941
public function admin_capabilities( $capabilities ) {

		foreach ( $this->components as $component => $component_data ) {
			if ( ! empty( $component_data['Hide'] ) ) {
				continue;
			}

			if ( ! pods_developer() ) {
				if ( true === (boolean) pods_v( 'DeveloperMode', $component_data, false ) ) {
					continue;
				}

				if ( true === (boolean) pods_v( 'TablelessMode', $component_data, false ) ) {
					continue;
				}
			}

			if ( empty( $component_data['MenuPage'] ) && ( ! isset( $component_data['object'] ) || ! method_exists( $component_data['object'], 'admin' ) ) ) {
				continue;
			}

			$capability = 'pods_component_' . str_replace( '-', '_', sanitize_title( str_replace( ' and ', ' ', strip_tags( $component_data['Name'] ) ) ) );

			if ( 0 < strlen( $component_data['Capability'] ) ) {
				$capability = $component_data['Capability'];
			}

			if ( ! in_array( $capability, $capabilities, true ) ) {
				$capabilities[] = $capability;
			}
		}//end foreach

		return $capabilities;
	}
1298159
public function checkGetId(Model $authority, $ability, $model = null)
    {
        $applicable = $this->compileAbilityIdentifiers($ability, $model);

        // We will first check if any of the applicable abilities have been forbidden.
        // If so, we'll return false right away, so as to not pass the check. Then,
        // we'll check if any of them have been allowed & return the matched ID.
        $forbiddenId = $this->findMatchingAbility(
            $this->getForbiddenAbilities($authority), $applicable, $model, $authority
        );

        if ($forbiddenId) {
            return false;
        }

        return $this->findMatchingAbility(
            $this->getAbilities($authority), $applicable, $model, $authority
        );
    }
256196
public function can($ability, $arguments = [])
    {
        foreach ($this->abilities as $check) {
            if (fnmatch($check, $ability)) {
                return true;
            }
        }

        return false;
    }
697051
protected function validate_authority( $capability ) {
		if ( ! $this->app->user_can( $capability ) ) {
			return new \WP_Error( 400, $this->app->translate( 'You have no authority.' ) );
		}

		return true;
	}
417682
protected function skip_row($capability) {
        $perm = $this->permissions[$capability->name];
        if ($perm == CAP_INHERIT) {
            // Do not print empty rows in role overview, admins need to know quickly what is allowed and prohibited,
            // if they want to see the list of all capabilities they can go to edit role page.
            return true;
        }
        parent::skip_row($capability);
    }
132985
public function secure($secure = null)
    {
        if ($secure !== null) {
            $this->secure = (bool) $secure;
        }

        return (bool) $this->secure;
    }
1300676
private function has_add_block_capability($page, $capability) {
        // Check if the capability exists.
        if (!get_capability_info($capability)) {
            // Debug warning that the capability does not exist, but no more than once per page.
            static $warned = array();
            if (!isset($warned[$this->name()])) {
                debugging('The block ' .$this->name() . ' does not define the standard capability ' .
                        $capability , DEBUG_DEVELOPER);
                $warned[$this->name()] = 1;
            }
            // If the capability does not exist, the block can always be added.
            return true;
        } else {
            return has_capability($capability, $page->context);
        }
    }
443263
public function canUse($feature)
    {
        // Get features and usage
        $feature_value = $this->value($feature);

        if (is_null($feature_value)) {
            return false;
        }

        // Match "booleans" type value
        if ($this->enabled($feature) === true) {
            return true;
        }

        // If the feature value is zero, let's return false
        // since there's no uses available. (useful to disable
        // countable features)
        if ($feature_value === '0') {
            return false;
        }

        // Check for available uses
        return $this->remainings($feature) > 0;
    }
270570
public function getCapability($capabilityName)
    {
        if (isset($this->_device->capabilities[$capabilityName])) {
            return $this->_device->capabilities[$capabilityName];
        }
                
        $key = $this->_device->id . "_" . $capabilityName;
        $capabilityValue = $this->_cacheProvider->get($key);
        if (empty($capabilityValue)) {
            $capabilityValue = $this->_deviceRepository->getCapabilityForDevice($this->_device->fallBack, $capabilityName);
            // save it in cache
            $this->_cacheProvider->put($key, $capabilityValue);
        }

        // prevent useless gets when retrieving the same capability from this device again
        //$this->_device->capabilities[$capabilityName] = $capabilityValue;

        return $capabilityValue;
    }
87610
protected function supportsSolution($solution): bool
    {
        $supportedClass = $this->supportedSolutionClass();

        return  null === $supportedClass || $solution instanceof $supportedClass;
    }
280025
public function grant($ability) {
    if (!in_array($ability, $this->abilities)) {
      return $this->abilities = array_merge([$ability], $this->abilities);
    }
    return true;
  }
436043
public function getGroupIDForCapability($capability)
    {
        if (!isset($capability) || !array_key_exists($capability, $this->_groupIDCapabilitiesMap)) {
            throw new InvalidArgumentException("an invalid capability was specified.");
        }
        return $this->_groupIDCapabilitiesMap[$capability];
    }