How to swap the roles from Readers field to Authors field on some event temporarily?

Iam working on a client based project.Iam using two roles in this:-

  1. User - Author from ACL

  2. SuperUser - Author from ACL

Current i have placed the USER role in the Author field and SuperUser role in the Reader field.

Candidates in the User role can submit a query to those candidates who are in the Superuser role.

Now what i wanted,as soon as when a candidate(User role) post a query to the candidates(Superuser role),their roles User and the Superuser roles should be swapped (now User role in Reader field and Superuser role in Author field) so that once the query is posted they cannot edit their query till they get any response from the candidate in the Superuser role.

As soon as they gets any reponse,their roles should come back to their respective fields ie. User in Author field and Superuser in the Reader field…

pls help me…to achieve this…

Your would be appreciated…

Subject: How to swap the roles from Readers field to Authors field on some event temporarily ?

Swtich the contents of the two fields. example

TempField := UserField;

@setfield(“UserField”;SupervisorField);

@setfield(“SupervisorField”;TempField);