# KnowledgeController

Extends \NPS\Controller\AbstractController

Controller for knowledge base operations

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\Symfony\Component\HttpFoundation\RequestStack $stack)

inherited

### Arguments

#### $stack

`\Symfony\Component\HttpFoundation\RequestStack`

## Denies access to a knowledge base for a group of users or an individual user

    denyAccessAction(\NPS\Repository\KnowledgeBaseRepository $knowledgeRepo, \NPS\Repository\UserRepository $userRepo, \Symfony\Component\HttpFoundation\Request $request)

Security | ("is_granted('ROLE_MANAGER') or is_granted('ROLE_ADMIN')")
Route | ("/knowledge/deny", methods={"POST"})

### Arguments

#### $knowledgeRepo

`\NPS\Repository\KnowledgeBaseRepository`

#### $userRepo

`\NPS\Repository\UserRepository`

#### $request

`\Symfony\Component\HttpFoundation\Request`

## Flushes any doctrine related changes

    flush()

inherited

## Returns current request

    getRequest() : \Symfony\Component\HttpFoundation\Request

inherited

### Response

`\Symfony\Component\HttpFoundation\Request`

## Grants access to a knowledge base for a group of users or an individual user

    grantAccessAction(\NPS\Repository\KnowledgeBaseRepository $knowledgeRepo, \NPS\Repository\UserRepository $userRepo, \Symfony\Component\HttpFoundation\Request $request)

Security | ("is_granted('ROLE_MANAGER') or is_granted('ROLE_ADMIN')")
Route | ("/knowledge/grant", methods={"POST"})

### Arguments

#### $knowledgeRepo

`\NPS\Repository\KnowledgeBaseRepository`

#### $userRepo

`\NPS\Repository\UserRepository`

#### $request

`\Symfony\Component\HttpFoundation\Request`

## Grants access to knowledge bases per user

    grantsAction(\NPS\Repository\KnowledgeBaseRepository $knowledgeRepo, \NPS\Repository\UserRepository $userRepo, \Symfony\Component\HttpFoundation\Request $request)

Security | ("is_granted('ROLE_MANAGER') or is_granted('ROLE_ADMIN')")
Route | ("/knowledge/grants", methods={"POST"})

### Arguments

#### $knowledgeRepo

`\NPS\Repository\KnowledgeBaseRepository`

#### $userRepo

`\NPS\Repository\UserRepository`

#### $request

`\Symfony\Component\HttpFoundation\Request`

## Lists knowledge bases visible for the user

    knowledgeAction(\NPS\Repository\KnowledgeBaseRepository $repository, \NPS\DependencyInjection\UserKnowledgeAccessGuard $guard)

Route | ("/knowledge")

### Arguments

#### $repository

`\NPS\Repository\KnowledgeBaseRepository`

#### $guard

`\NPS\DependencyInjection\UserKnowledgeAccessGuard`

## Creates a response

    response(array $data = array()) : \Symfony\Component\HttpFoundation\Response

inherited

### Arguments

#### $data

`array`

### Response

`\Symfony\Component\HttpFoundation\Response`

### Properties

## Current request

    request : \Symfony\Component\HttpFoundation\Request

inherited

var | Current request

### Type(s)

`\Symfony\Component\HttpFoundation\Request`