Files
apollinare-catering-software/docs/functions/F_USER_IN_ROLE.md
2025-12-17 13:02:12 +01:00

437 B

F_USER_IN_ROLE

Codice Sorgente

FUNCTION F_USER_IN_ROLE 
(
  P_USER IN VARCHAR2 
, P_ROLE IN VARCHAR2 
) RETURN NUMBER AS 
    v_has_role number := 0;
BEGIN
    select count(column_value)
    into v_has_role
    from tb_config, table(split(strvalue, ':'))
    where upper(name) = upper(P_ROLE)
      and upper(column_value) = upper(P_USER);
    
    return case when v_has_role > 0 then 1 else 0 end;
END F_USER_IN_ROLE;```