campingmontagut/test/roles.sql
jordi fita mas 5d0861824a Add authentication relations, views, and functions for PostgreSQL
Most of them are exactly the same as we use for Numerus, but with the
main application schema changed to camper.

Closes #1
2023-07-22 01:59:12 +02:00

24 lines
492 B
PL/PgSQL

-- Test roles
set client_min_messages to warning;
create extension if not exists pgtap;
reset client_min_messages;
begin;
select plan(8);
select has_role('guest');
select has_role('employee');
select has_role('admin');
select has_role('authenticator');
select is_member_of('guest', 'authenticator');
select is_member_of('employee', 'authenticator');
select is_member_of('admin', 'authenticator');
select is_member_of('authenticator', array[]::text[]);
select *
from finish();
rollback;