Annotation: office.is_admin

CREATE OR REPLACE FUNCTION office.is_admin(integer)
RETURNS boolean

Information: office.is_admin

Schema office
Function Name is_admin
Arguments integer
Owner postgres
Result Type boolean
Description

Implementation: office.is_admin

CREATE OR REPLACE FUNCTION office.is_admin(integer)
 RETURNS boolean
 LANGUAGE plpgsql
AS $function$
BEGIN
    RETURN
    (
        SELECT office.roles.is_admin FROM office.users
        INNER JOIN office.roles
        ON office.users.role_id = office.roles.role_id
        WHERE office.users.user_id=$1
    );
END
$function$