Hi,
I have been trying for a while to fix apermission problem, I just
wanted to know that whether you would port the code for a
loop in xql file same as we did for the .sql files.
I am not sure of this, here is my code for the .xql file
see if anyone can advice me on how to go from here.
create function inline_0 ()
returns integer as'
declare
add_a record;
add_b record;
add_c record;
begin
if :role = 'read' then
for add_a in select member_id
from group_member_map
where group_id = :group_id;
loop
acs_permission__grant_permission(:pres_item_id,
c__member_id,
'wp_view_presentation');
end loop;
else if (:role = 'write') then
for add_b in select member_id
from group_member_map
where group_id = :group_id;
loop
acs_permission__grant_permission(:pres_item_id,
c__member_id,
'wp_view_presentation');
acs_permission__grant_permission(:pres_item_id,
c__member_id,
'wp_edit_presentation');
end loop;
else
for add_c in select member_id
from group_member_map
where group_id = :group_id;
loop
acs_permission__grant_permission(:pres_item_id,
c__member_id,
'wp_view_presentation');
acs_permission__grant_permission(:pres_item_id,
c__member_id,
'wp_edit_presentation');
acs_permission__grant_permission(:pres_item_id,
c__member_id,
'wp_admin_presentation');
end loop;
end if;
end;' langauge 'plpgsql';
select inline_0 ();
drop function inline_0 ();