It's all about the answers!

Ask a question

Programmatically login with a hard coded admin account with all privileges (RTC Java Api / server-side)


Carlos Benavides (212) | asked May 03 '18, 12:30 p.m.

Hi Forum!

I will give the whole context:

We are developing a follow-up action called "E-mail notification" that sends an email when a work item changes it's state on a project area called (for example) "Project 1".

These notifications are based on "E-mail rules" which are work items from another project area called "Project 2". These e-mail rules provides information about WHEN an email should be sent, to WHOM it should be sent and WHAT content it should have.

And now here is the issue:

Our plugin needs to programatically run a query on "Project 2" where a regular user has not access to or this user should not see. This plugin works when we are logged in with an admin account that has all permissions and privileges, obviously. But is not working when a regular user is logged in and tries to save a work item due to, I think, lack of permissions and privileges.

So my questions are:

On server-side, is it possible to hard code an admin account that logins instead of the regular user, then perform all the code as an admin, and finally logs out? How?

If this is possible, is it safe?


Any help would be appreciated.

Thank you!

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.