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.join_date,
		u.birth_date,
		u.profile_avatar,
		u.profile_banner,
		u.profile_bio
	FROM
		admin.user u;

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