Hi Jagath,
though this use-case it not advisable (i.e. typically UI and code should be clearly separated, especially w.r.t ACL handling), it can be achieved.
You can write a query stored procedure (search the help for "Java Stored Procedure") which returns the user's roles, and use this as wiki parameter in the referenced templates using the #sparql parser function.
Note that a user may have multiple groups/roles.
The best practice would be to solve such use-cases using ACLs, i.e. by granting / restricting access to resources for certain user groups.
Best,
Andreas