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 _url text; _user_group_id int; begin _url = (select url from dashboard d where d.prop_id = $1 and d.user_id = $2); if _url is null then _user_group_id = coalesce(public.fn_user_primary_group($2, $1), (select user_group_id from users where id = $2)); _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 _url is null then _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 _url; end