	Create or replace FUNCTION __temp_insert_read_only_admin_role()	1
			RETURNS VOID	2
			AS $procedure$	3
			DECLARE	4
			v_ROLE_ID UUID;	5
			BEGIN	6
			v_ROLE_ID := 'DEF0000C-0000-0000-0000-DEF00000000C';	7
				8
			DELETE FROM roles_groups WHERE role_id = v_ROLE_ID;	9
			INSERT INTO roles(id,name,description,is_readonly,role_type,allows_viewing_children,app_mode) SELECT
v_ROLE_ID, 'ReadOnlyAdmin', 'Read Only Administrator Role', true, 1, true, 1	10
			WHERE NOT EXISTS (SELECT id,name,description,is_readonly,role_type	11
			FROM roles	12
			WHERE id = v_ROLE_ID	13
			AND name='ReadOnlyAdmin'	14
			AND description='Read Only Administrator Role'	15
			AND is_readonly=true	16
			AND role_type=1);	17
				18
			-- Allowing this role to login 	19
			INSERT INTO roles_groups(role_id,action_group_id) VALUES(v_ROLE_ID, 1300);	20
				21
			RETURN;	22
			END; $procedure$	23
			LANGUAGE plpgsql;	24
				25
			SELECT __temp_insert_read_only_admin_role();	26
			DROP function __temp_insert_read_only_admin_role();
