You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function get_available_layers_rpc, which is called every time the client opens an annotation szession, often returns an emtpy first row. It depends; sometimes this behavior isn't shown.
In the function code below the RETURN NEXT statement right after the policy check should be a simple RETURN. This way no empty rows are returned. Also the function will not return any information if the policy check fails (at the moment the policy check is ineffective).
DECLARE
_context_name VARCHAR;
_document_id uuid;
_contexts_row public.contexts % rowtype;
_layer_context_row public.layer_contexts % rowtype;
_layer_row public.layers % rowtype;
BEGIN
-- Check project policy that contexts can be selected by this user
IF NOT (check_action_policy_organization(auth.uid(), 'contexts', 'SELECT')
OR check_action_policy_project(auth.uid(), 'contexts', 'SELECT', _project_id))
THEN
RETURN NEXT;
END IF;
-- Find all documents in the current context
FOR _document_id IN SELECT pd.document_id
FROM public.project_documents pd WHERE pd.project_id = _project_id AND pd.is_archived IS NOT TRUE
LOOP
FOR _contexts_row IN SELECT * FROM public.contexts c
WHERE c.project_id = _project_id
LOOP
FOR _layer_context_row IN SELECT * FROM public.layer_contexts lcx
WHERE lcx.context_id = _contexts_row.id AND lcx.is_archived IS NOT TRUE
LOOP
FOR _layer_row IN SELECT * FROM public.layers l
WHERE l.id = _layer_context_row.layer_id AND l.document_id = _document_id AND l.is_archived IS NOT TRUE
LOOP
document_id := _document_id;
context_id := _contexts_row.id;
is_active := _layer_context_row.is_active_layer;
layer_id := _layer_row.id;
context_name := _contexts_row.name;
RETURN NEXT;
END LOOP;
END LOOP;
END LOOP;
END LOOP;
END
The text was updated successfully, but these errors were encountered:
The function
get_available_layers_rpc
, which is called every time the client opens an annotation szession, often returns an emtpy first row. It depends; sometimes this behavior isn't shown.In the function code below the
RETURN NEXT
statement right after the policy check should be a simpleRETURN
. This way no empty rows are returned. Also the function will not return any information if the policy check fails (at the moment the policy check is ineffective).The text was updated successfully, but these errors were encountered: