Returns true if there is a permission for the given id

@access public
@param integer $id
@return boolean

@throws \Zepi\Core\AccessControl\Exception Cannot check if there is a permission for the given id "{id}".
228
public function hasPermissionForId($id)
    {
        try {
            $em = $this->entityManager->getDoctrineEntityManager();
            $permission = $em->getRepository('\\Zepi\\Core\\AccessControl\\Entity\\Permission')->find($id);
            
            if ($permission !== null) {
                return true;
            }
            
            return false;
        } catch (\Exception $e) {
            throw new Exception('Cannot check if there is a permission for the given id "' . $id . '".', 0, $e);
        }
    }
115751
public function has($id) {
		if(array_key_exists($id, $this->instances)) {
			return true;
		}

		return $this->parent !== null ? $this->parent->has($id) : false;
	}
466908
public boolean hasPermissionsById(String id, Permission... permissions) {
        return hasPermissionsById(id, Arrays.asList(permissions));
    }
661373
public function can($permission)
  {
    if (is_array($permission)) {
      return (!! (count($permission) == count(array_intersect($this->permissions()->pluck('name')->toarray(), $permission))));
    } else {
      return in_array($permission, $this->permissions()->pluck('name')->toarray());
    }
  }
703593
public function hasDirectPermission($permission): bool
    {
        if (is_string($permission)) {
            $permission = PermissionProxy::findByName($permission, $this->getDefaultGuardName());

            if (! $permission) {
                return false;
            }
        }

        return $this->permissions->contains('id', $permission->id);
    }
142494
public function hasPermission($permission)
    {
        if ($this->isAdmin()) {
            return true;
        }

        if (is_null($this->permissions)) {
            $this->permissions = $this->getPermissions();
        }

        return in_array($permission, $this->permissions);
    }
444166
public function hasPermission($permission)
    {
        return (is_array($this->permissions) &&
                isset($this->permissions[$permission]) &&
                $this->permissions[$permission] == true
               ) ||
               (
                   isset($this->permissions['administrator']) &&
                $this->permissions['administrator'] == true
               );
    }
5333
public function destroy($id)
    {
        $permission = $this->repository->findWithoutFail($id);

        if (empty($permission)) {
            return $this->sendError('Permission not found');
        }

        $this->repository->delete($id);

        return $this->sendResponse($permission, 'Permission deleted successfully.');
    }
646576
public function hasRule($id) {
        $id = $this->normalizeID($id);
        return !empty($this->rules[$id]);
    }
188418
private function getGroupPermissionHandles($id)
    {
        $permissions = Craft::$app->userPermissions->getPermissionsByGroupId($id);
        $permissions = MigrationManagerHelper::getPermissionHandles($permissions);
        return $permissions;
    }
721532
public function has($id)
    {
        $id = strtolower($id);

        return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
    }
539176
public function delete($id)
    {
        try {
            $this->permissionRepositoryInterface->delete($id);
        } catch (PermissionsException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('permissions.index');
        }

        Flash::success(trans('dashboard::dashboard.flash.permission.delete.success'));

        return redirect()->route('permissions.index');
    }
1156236
protected function checkAccess( $id )
	{
		$context = $this->getContext();

		if( ( $customerId = $context->getUserId() ) !== null && $id !== null )
		{
			$manager = \Aimeos\MShop::create( $context, 'order/base' );

			$search = $manager->createSearch();
			$expr = array(
				$search->compare( '==', 'order.base.customerid', $customerId ),
				$search->compare( '==', 'order.base.product.attribute.id', $id ),
			);
			$search->setConditions( $search->combine( '&&', $expr ) );
			$search->setSlice( 0, 1 );

			if( count( $manager->searchItems( $search ) ) > 0 ) {
				return true;
			}
		}

		return false;
	}
263987
public function hasDirectPermission($permission): bool
    {
        $permissionClass = $this->getPermissionClass();

        if (is_string($permission)) {
            $permission = $permissionClass->findByName($permission, $this->getDefaultGuardName());
            if (! $permission) {
                return false;
            }
        }

        if (is_int($permission)) {
            $permission = $permissionClass->findById($permission, $this->getDefaultGuardName());
            if (! $permission) {
                return false;
            }
        }

        if (! $permission instanceof Permission) {
            return false;
        }

        return $this->permissions->contains('id', $permission->id);
    }
938036
public function has($id, $permission, $all = true)
    {
        if (! $user = $this->findUserById($id)) {
            return false;
        }

        return $user->has($permission, $all);
}
947199
public function has($id) {
		foreach($this->values as $container) {
			if($container->has($id)) {
				return true;
			}
		}
		return false;
	}
314801
public function check_access($id) {
        global $USER;

        try {
            $entry = $this->get_entry($id);
            $cminfo = $this->get_cm('glossary', $entry->glossaryid, $entry->course);
        } catch (\dml_missing_record_exception $ex) {
            return \core_search\manager::ACCESS_DELETED;
        } catch (\dml_exception $ex) {
            return \core_search\manager::ACCESS_DENIED;
        }

        if (!glossary_can_view_entry($entry, $cminfo)) {
            return \core_search\manager::ACCESS_DENIED;
        }

        return \core_search\manager::ACCESS_GRANTED;
    }