SwitchUserRole

SwitchUserRole

class SwitchUserRole extends Role

SwitchUserRole is used when the current user temporarily impersonates another one.

Methods

__construct(string $role, TokenInterface $source)

Constructor.

string|null getRole()

Returns the role.

from Role
TokenInterface getSource()

Returns the original Token.

Details

__construct(string $role, TokenInterface $source)

Constructor.

Parameters

string $role The role name
TokenInterface $source The original token

string|null getRole()

Returns the role.

This method returns a string representation whenever possible.

When the role cannot be represented with sufficient precision by a string, it should return null.

Return Value

string|null A string representation of the role, or null

TokenInterface getSource()

Returns the original Token.

Return Value

TokenInterface The original TokenInterface instance

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/Security/Core/Role/SwitchUserRole.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部