\Thelia\Core\SecuritySecurityContext

A simple security manager, in charge of checking user

Summary

Methods
Properties
Constants
__construct()
setContext()
getContext()
getUser()
isAuthenticated()
isGranted()
setUser()
clear()
No public properties found
CONTEXT_FRONT_OFFICE
CONTEXT_BACK_OFFICE
No protected methods found
No protected properties found
N/A
getSession()
$request
$context
N/A

Constants

CONTEXT_FRONT_OFFICE

CONTEXT_FRONT_OFFICE

CONTEXT_BACK_OFFICE

CONTEXT_BACK_OFFICE

Properties

$request

$request

$context

$context

Methods

setContext()

setContext( $context)

Parameters

$context

getContext()

getContext( $exception_if_context_undefined)

Parameters

$exception_if_context_undefined

getUser()

getUser() : \Thelia\Core\Security\User\UserInterface|null

Gets the currently authenticated user in the current context, or null if none is defined

Returns

\Thelia\Core\Security\User\UserInterface|null —

A UserInterface instance or null if no user is available

isAuthenticated()

isAuthenticated()

isGranted()

isGranted(array $roles, array $permissions) : Boolean

Checks if the current user is allowed

Parameters

array $roles
array $permissions

Returns

Boolean

setUser()

setUser(\Thelia\Core\Security\User\UserInterface $user)

Sets the authenticated user.

Parameters

\Thelia\Core\Security\User\UserInterface $user

A UserInterface, or null if no further user should be stored

clear()

clear()

Clear the user from the security context

getSession()

getSession()