FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Auth\Auth Class Reference

Contains the constants and helpers for authentication of user. More...

Collaboration diagram for Fossology\Lib\Auth\Auth:
Collaboration graph

Static Public Member Functions

static getUserId ()
 Get the current user's id. More...
 
static getGroupId ()
 Get the current user's group id. More...
 
static isAdmin ()
 Check if user is admin. More...
 
static isClearingAdmin ()
 Check if user is clearing admin. More...
 
static getRestTokenType ()
 

Public Attributes

const USER_NAME = 'User'
 
const USER_ID = 'UserId'
 
const GROUP_ID = 'GroupId'
 
const USER_LEVEL = 'UserLevel'
 
const PERM_NONE = 0
 
const PERM_READ = 1
 
const PERM_WRITE = 3
 
const PERM_CADMIN =5
 
const PERM_ADMIN =10
 
const TOKEN_OAUTH = 0x1
 
const TOKEN_TOKEN = 0x2
 
const TOKEN_BOTH = 0x3
 

Detailed Description

Contains the constants and helpers for authentication of user.

Permissions See https://github.com/fossology/fossology/wiki/Access-Control

Examples
/home/runner/work/fossology/fossology/src/www/ui/ui-picker.php.

Definition at line 23 of file Auth.php.

Member Function Documentation

◆ getGroupId()

static Fossology\Lib\Auth\Auth::getGroupId ( )
static

Get the current user's group id.

Returns
int Group id

Definition at line 80 of file Auth.php.

◆ getRestTokenType()

static Fossology\Lib\Auth\Auth::getRestTokenType ( )
static

Get REST Token format from conf

Returns
int Auth::TOKEN_TOKEN | Auth::TOKEN_OAUTH | Auth::TOKEN_BOTH

Definition at line 110 of file Auth.php.

◆ getUserId()

static Fossology\Lib\Auth\Auth::getUserId ( )
static

Get the current user's id.

Returns
int User id

Definition at line 68 of file Auth.php.

◆ isAdmin()

static Fossology\Lib\Auth\Auth::isAdmin ( )
static

Check if user is admin.

Returns
boolean True if user is an admin, false otherwise.

Definition at line 92 of file Auth.php.

◆ isClearingAdmin()

static Fossology\Lib\Auth\Auth::isClearingAdmin ( )
static

Check if user is clearing admin.

Returns
boolean True if user is an clearing admin or more, false otherwise.

Definition at line 101 of file Auth.php.

Member Data Documentation

◆ GROUP_ID

string Fossology\Lib\Auth\Auth::GROUP_ID = 'GroupId'

Session variable name containing group id

Definition at line 33 of file Auth.php.

◆ PERM_ADMIN

int Fossology\Lib\Auth\Auth::PERM_ADMIN =10

Add/delete users and groups. This is the 'superuser' permission.

Definition at line 52 of file Auth.php.

◆ PERM_NONE

int Fossology\Lib\Auth\Auth::PERM_NONE = 0

No permissions

Definition at line 40 of file Auth.php.

◆ PERM_READ

int Fossology\Lib\Auth\Auth::PERM_READ = 1

Read only permission

Definition at line 43 of file Auth.php.

◆ PERM_WRITE

int Fossology\Lib\Auth\Auth::PERM_WRITE = 3

DB writes permitted

DB writes permitted, with additional clearing permissions.

Definition at line 46 of file Auth.php.

◆ TOKEN_BOTH

int Fossology\Lib\Auth\Auth::TOKEN_BOTH = 0x3

Allow both token formats for REST

Definition at line 62 of file Auth.php.

◆ TOKEN_OAUTH

int Fossology\Lib\Auth\Auth::TOKEN_OAUTH = 0x1

Allow OAuth tokens for REST

Definition at line 56 of file Auth.php.

◆ TOKEN_TOKEN

int Fossology\Lib\Auth\Auth::TOKEN_TOKEN = 0x2

Allow FOSSology JWT tokens for REST

Definition at line 59 of file Auth.php.

◆ USER_ID

string Fossology\Lib\Auth\Auth::USER_ID = 'UserId'

Session variable name containing user id

Definition at line 30 of file Auth.php.

◆ USER_LEVEL

string Fossology\Lib\Auth\Auth::USER_LEVEL = 'UserLevel'

Session variable name containing user permission level

Definition at line 36 of file Auth.php.

◆ USER_NAME

string Fossology\Lib\Auth\Auth::USER_NAME = 'User'

Session variable name containing user name

Definition at line 27 of file Auth.php.


The documentation for this class was generated from the following file: