User

Represents an authenticates User and contains operations to authorise the user.

Please consult the documentation for a detailed explanation.

package

Default

Methods

__construct

__construct() 

The User object will cache any authorities that it knows it has to avoid hitting the underlying auth provider each time. Use this method if you want to clear this cache.

clearCache() : $this

Response

$this

the User to enable fluent use

isAuthorised

isAuthorised( $arg0,  $arg1) : $this
deprecated

Arguments

$arg0

string

$arg1

callable

Response

$this

Is the user authorised to

isAuthorized( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

the User to enable fluent use

Get the underlying principal for the User. What this actually returns depends on the implementation.

principal() : array

For a simple user/password based auth, it's likely to contain a JSON object with the following structure:

  {
    "username", "tim"
  }

Response

array

JSON representation of the Principal

Set the auth provider for the User. This is typically used to reattach a detached User with an AuthProvider, e.g.

setAuthProvider( $arg0) : void

after it has been deserialized.

Arguments

$arg0

AuthProvider