16 lines
257 B
PL/PgSQL
16 lines
257 B
PL/PgSQL
CREATE FUNCTION _api.raise_deny()
|
|
RETURNS BOOLEAN
|
|
LANGUAGE plpgsql VOLATILE
|
|
AS $BODY$
|
|
BEGIN
|
|
PERFORM _api.raise(
|
|
_msg => 'api_denied',
|
|
_err => 403
|
|
);
|
|
|
|
RETURN TRUE;
|
|
END
|
|
$BODY$;
|
|
|
|
GRANT EXECUTE ON FUNCTION _api.raise_null(TEXT)
|
|
TO rest_anon, rest_user;
|