\ServiceSecurityProvider

Interface for security provider.

Summary

Methods
Constants
create_session()
connect()
set_token()
get_self_id()
get_self_login()
login_as()
has_permit()
validate_permit()
get_login_field_name()
get_session_id_field_name()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

create_session()

create_session(string  $Token = '') : string

Method creates session from existing token or fetched from HTTP headers.

Parameters

string $Token
  • Session token.

Returns

string —

Session token.

connect()

connect(string  $Login, string  $Password) : string

Method creates conection session.

Parameters

string $Login
  • Login.
string $Password
  • Password.

Returns

string —

Session id of the created session.

set_token()

set_token(string  $Token) : string

Method sets session token.

Parameters

string $Token
  • Token.

Returns

string —

Session token id.

get_self_id()

get_self_id(string  $Token) : integer

Method returns id of the session user.

Parameters

string $Token
  • Token.

Returns

integer —

id of the session user.

get_self_login()

get_self_login(string  $Token) : string

Method returns login of the session user.

Parameters

string $Token
  • Token.

Returns

string —

login of the session user.

login_as()

login_as(string  $Token, string  $LoginOrId, string  $Field) : string

Method allows user to login under another user.

Parameters

string $Token
  • Token.
string $LoginOrId
  • In this field login or user id are passed..
string $Field
  • Contains 'login' or 'id'.

Returns

string —
  • New session id.

has_permit()

has_permit(string  $Token, string  $Permit) : boolean

Method returns true or false if the session user has permit or not.

Parameters

string $Token
  • Token.
string $Permit
  • Permit name.

Returns

boolean —

True if the

validate_permit()

validate_permit(string  $Token, string  $Permit) 

Method throws exception if the user does not have permit.

Parameters

string $Token
  • Token.
string $Permit
  • Permit name.

get_login_field_name()

get_login_field_name() : string

Method returns field name for login.

Returns

string —

Field name.

get_session_id_field_name()

get_session_id_field_name() : string

Method returns field name for session_id.

Returns

string —

Field name.