class SudoModeService implements SudoModeServiceInterface (View source)

Traits

Provides extensions to this object to integrate it with standard config API methods.

Constants

private SUDO_MODE_SESSION_KEY

The session key that is used to store the timestamp for when sudo mode was last activated

Config options

lifetime_minutes int

The lifetime that sudo mode authorization lasts for, in minutes.

Properties

Methods

public static 
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

public
mixed
uninherited(string $name)

Gets the uninherited value for the given config option

public
bool
check(Session $session)

Checks the current session to see if sudo mode was activated within the last section of lifetime allocation.

public
bool
activate(Session $session)

Register activated sudo mode permission in the provided session, which lasts for the configured lifetime.

public
int
getLifetime()

How long the sudo mode activation lasts for in minutes.

Details

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

bool check(Session $session)

Checks the current session to see if sudo mode was activated within the last section of lifetime allocation.

Parameters

Session $session

Return Value

bool

if sudo mode is currently active

bool activate(Session $session)

Register activated sudo mode permission in the provided session, which lasts for the configured lifetime.

Parameters

Session $session

Return Value

bool

on success

int getLifetime()

How long the sudo mode activation lasts for in minutes.

Return Value

int