authen
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
fn_dashboard_url
Parameters
Name
Type
Mode
prop_id
integer
IN
user_id
integer
IN
Definition
declare _user_group_id int; _dashboard_url text; BEGIN _dashboard_url := (select url from dashboard d where d.prop_id = $1 and d.user_id = $2); if _dashboard_url is null then _user_group_id = (select user_group_id from users where id = $2); _dashboard_url := (select url from dashboard d where d.prop_id = $1 and d.user_id is null and d.user_group_id = _user_group_id); end if; if _dashboard_url is null then _dashboard_url := (select url from dashboard d where d.prop_id = $1 and d.user_id is null and d.user_group_id is null); end if; return coalesce(_dashboard_url,'https://empty-dashboard'); end;