Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Query the user permissions for a Project?

Is there a way to review the existing user permsions for a project in TestRail 5.6.0.3865 ? As of this month, management will require a report with user access lists for every project. Doing this visualy can create errors, and the user export csv only lists the user id, email address, status, and role.

Is there an API or SQL DB query we can perform on an On-Premise server to drill down into the project access permissions per user?

  • Rudy

Hi Rudy,

Currently, there aren’t any API endpoints or CSV exports which would provide project access details for users to meet your requirements.

With TestRail Server, you would be able to query this data from the database directly. While I don’t have an exact set of queries to provide, you should be able to use the project-related and role-related tables to collect the access data you need for users.

User permissions in projects are provided in this order, highest precedence to lowest:

  • User’s role assignment inside the project
  • User’s group role assignment inside the project
  • Project’s default role assignment
  • User’s ‘global’ role assigned under Administration > Users & Roles

As always, we would recommend never making any changes directly to TestRail’s database, as any changes to data should be made through TestRail’s UI or API when needed. Changes made directly to TestRail’s database can lead to data inconsistencies and corruption within TestRail.

I hope this helps,
Jon

Thanks for the response, we had no need to remove or manipulate the DB, we just needed a way to directly ‘pull’ information on user memberships. Would your team be able to provide an SQL query to pull this information? I hate poking around looking for TestRail’s table links.