Home Reference Source Repository
public class | source

Auth

You can directly use instance of this class. auth

Handle authentication and permissions

Constructor Summary

Public Constructor
public
Fetch the needed data from the page.

Member Summary

Public Members
public
public

user: *

Method Summary

Public Methods
public

get_auth_url(message: *): *

Build the authentication URL given the current page and an optionnal message.
public

has_role(role: *): *

Check that the current authenticated user has a given role.
public

need_role(role: *, message: *)

Check that the current authenticated user has a given role.
public

need_user(message: *): boolean

Check if an user is authenticated

Public Constructors

public constructor source

Fetch the needed data from the page.

Public Members

public auth_url: * source

public user: * source

Public Methods

public get_auth_url(message: *): * source

Build the authentication URL given the current page and an optionnal message.

Params:

NameTypeAttributeDescription
message *

Return:

*

public has_role(role: *): * source

Check that the current authenticated user has a given role.

Params:

NameTypeAttributeDescription
role *

Return:

*

public need_role(role: *, message: *) source

Check that the current authenticated user has a given role. Notify if not.

Params:

NameTypeAttributeDescription
role *
message *

public need_user(message: *): boolean source

Check if an user is authenticated

Params:

NameTypeAttributeDescription
message *

Return:

boolean