Schema: auth

auth

Authorization related objects



Tables


data_source_person

Data source person

Name Type Description
person_id integer

foreign key to auth.person.id

id integer
data_source_id integer

foreign key to data.data_source.id


event

Table of events

Name Type Description
time_modified timestamp_without_time_zone
description character_varying
is_active boolean
tenant_id integer
app_id integer
event_type_id integer
id uuid

primary key

name character_varying


event_date

Event date

Name Type Description
datetime timestamp_without_time_zone
time_modified timestamp_without_time_zone
event_id uuid
period_id integer
id uuid


log

Log of user actions

Name Type Description
ip character_varying
id integer
person_id integer

foreign key to auth.person.id

time_modified timestamp_without_time_zone


news_role

News role

Name Type Description
id integer
news_id integer

foreign key to meta.news.id

role_id integer

foreign key to auth.role.id


partner

Partner

Name Type Description
partner_email character_varying
id integer
partner_user_id integer

foreign key to auth.person.id

user_id integer

foreign key to auth.person.id


person

Catalog of persons related to the project (including users).

Name Type Description
agreed timestamp_with_time_zone
id integer
first_name character_varying
last_name character_varying
partner_id integer

foreign key to general.partner.id

email character_varying
name1 character_varying
user_email character_varying
nickname character_varying
name character_varying


person_role

This table contains the roles that a person can have in the system.

Name Type Description
role_id integer

foreign key to auth.role.id

id integer
person_id integer

foreign key to auth.person.id


role

Roles for public users.

Name Type Description
id integer
name character_varying


route_role

Route role

Name Type Description
role_id integer

foreign key to auth.role.id

route_id integer

foreign key to meta.route.id

id integer
read_only boolean


user

User

Name Type Description
gender character
time_modified timestamp_without_time_zone
display_name character_varying
phone_number character_varying
last_name character_varying
email character_varying
first_name character_varying
user_name character_varying
id uuid
personal_id character_varying


user_role

User role

Name Type Description
user_id uuid
time_modified timestamp_without_time_zone
role_id uuid
id uuid


vw_partner

Vw partner

Name Type Description
partner_user_id integer
user_id integer


Functions

accept_agreement

Accept agreement

Parameters:
Name Type Description
PersonId integer
Source:
Returns:
Type
void

create_context

Create context of the user

Parameters:
Name Type Description
UserId uuid
LangId integer
AppId integer
ImpersonatedUserId uuid
Source:
Returns:
Type
void

create_public_context

Create public context

Parameters:
Name Type Description
PersonId integer
LangId integer
Source:
Returns:
Type
void

create_user

Create user of auxiliary backoffice app

Parameters:
Name Type Description
PersonId integer
Source:
Returns:
Type
void

get_context_app_id

Get app id from the context

Source:
Returns:
Type
integer

get_context_is_admin

Get is admin from the context

Source:
Returns:
Type
integer

get_context_lang_id

Get lang id from the context

Source:
Returns:
Type
integer

get_context_person_id

Get person id from the context

Source:
Returns:
Type
integer

get_context_tenant_id

Get tenant id from the context

Source:
Returns:
Type
integer

get_context_user_id

Get user id from the context

Source:
Returns:
Type
uuid

get_context_user_id_for_data

Get user id of the impersonated user from the context

Source:
Returns:
Type
uuid

get_event_dates

Get event dates

Parameters:
Name Type Description
TenantId integer
PeriodId integer
AppId integer
Properties:
Name Type Description
event_id uuid
datetime timestamp_without_time_zone
Source:
Returns:
Type
Object

get_or_create_person_id

Get or create person id - registers new user if not already registered

Parameters:
Name Type Description
Email character_varying
FirstName character_varying
LastName character_varying
Source:
Returns:
Type
integer

get_users

Get users

Source:
Returns:
Type
json

login

Records a login event and returns the person record.

Parameters:
Name Type Description
PersonId integer
IP character_varying
Source:
Returns:
Type
json

person_role_history

Person role public history trigger function

Source:
Returns:
Type
trigger

role_history

Role public history trigger function

Source:
Returns:
Type
trigger

route_role_history

Route role public history trigger function

Source:
Returns:
Type
trigger