# UserKnowledgeAccessGuard

Restricts access of a user to specific knowledge bases

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface $auth, boolean $grantOverride)

### Arguments

#### $auth

`\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface`

#### $grantOverride

`boolean`

Makes grants inapplicable if true

## Filters list of knowledge bases for a user

    filterAccessible(array $knowledgeBases, \NPS\Model\User $user = null) : array

### Arguments

#### $knowledgeBases

`array`

#### $user

`\NPS\Model\User`

### Response

`array`

## Filters by applicable user grants

    filterByGrants(\NPS\Model\KnowledgeBase $base, \NPS\Model\User $user) : boolean

### Arguments

#### $base

`\NPS\Model\KnowledgeBase`

#### $user

`\NPS\Model\User`

### Response

`boolean`

## Filters access by knowledge base status

    filterByStatus(\NPS\Model\KnowledgeBase $base, \NPS\Model\User $user = null) : false

### Arguments

#### $base

`\NPS\Model\KnowledgeBase`

#### $user

`\NPS\Model\User`

### Response

`false`

## Determines if a user has access to the knowledge base

    hasAccess(\NPS\Model\KnowledgeBase $base, \NPS\Model\User|null $user = null) : boolean

### Arguments

#### $base

`\NPS\Model\KnowledgeBase`

#### $user

`\NPS\Model\User|null`

### Response

`boolean`

### Properties

## auth

    auth : \Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface

var |

### Type(s)

`\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface`

## Knowledge access override, makes grants inapplicable

    grantOverride : boolean

var | Knowledge access override, makes grants inapplicable

### Type(s)

`boolean`