postgresql7.1
select chat_room__new (
NULL,
:pretty_name,
:description,
:moderated_p,
:active_p,
:archive_p,
:auto_flush_p,
:auto_transcript_p,
:context_id,
now(),
:creation_user,
:creation_ip,
'chat_room'
)
-- Automatic grant room privilege to creator of the room (must not be null).
begin
if :creation_user <> ''
then
perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_room_edit');
perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_room_view');
perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_room_delete');
perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_transcript_create');
end if;
return 0;
end;
select chat_room__name (:room_id) from dual;
select person__name(:user_id);
begin
perform acs_permission__grant_permission(:room_id, :party_id, 'chat_write');
perform acs_permission__grant_permission(:room_id, :party_id, 'chat_read');
return 0;
end;
begin
perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_write');
perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_read');
return 0;
end;
begin
perform acs_permission__grant_permission(:room_id, :party_id, 'chat_ban');
return 0;
end;
begin
perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_ban');
return 0;
end;
begin
perform acs_permission__grant_permission(:room_id, :party_id, 'chat_room_moderate');
return 0;
end;
begin
perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_room_moderate');
return 0;
end;
begin
perform chat_room__edit (
:room_id,
:pretty_name,
:description,
:moderated_p,
:active_p,
:archive_p,
:auto_flush_p,
:auto_transcript_p
);
return 0;
end;
select chat_room__message_count(:room_id);
begin
perform chat_room__delete_all_msgs(:room_id);
return 0;
end;
select chat_transcript__new (
:pretty_name,
:contents,
:description,
:room_id,
:context_id,
now(),
:creation_user,
:creation_ip,
'chat_transcript'
)
begin
-- Automatic grant transcript privilege to creator of the transcript (must not be null).
if :creation_user is not null
then
perform acs_permission__grant_permission(:transcript_id, :creation_user, 'chat_transcript_edit');
perform acs_permission__grant_permission(:transcript_id, :creation_user, 'chat_transcript_view');
perform acs_permission__grant_permission(:transcript_id, :creation_user, 'chat_transcript_delete');
end if;
return 0;
end;
begin
perform chat_transcript__del(:transcript_id);
return 0;
end;
select chat_room__message_post (:room_id, :msg, :creation_user, :creation_ip);
select chat_room__del(:room_id);
begin
perform chat_transcript__edit (
:transcript_id,
:pretty_name,
:contents,
:description);
return 0;
end;