CREATE VIEW api.user AS
	SELECT
		u.id,
		u.username,
		NULL AS password,
		u.role,
		u.first_name,
		u.last_name,
		u.middle_name,
		u.email,
		u.gender,
		u.birth_date,
		u.profile_bio,
		u.created,
		u.modified,
		u.seen
	FROM
		admin.user u
	WHERE
		u.deleted <> TRUE;

GRANT SELECT ON TABLE api.user
	TO rest_anon, rest_user;
GRANT SELECT ON TABLE admin.user
	TO rest_anon, rest_user;
