A read-only user in a database has exclusive permissions to read information and execute query reports. This configuration ensures secure querying and blocks access to sensitive data within the application database.
Role Required: Organization Admin, SDAdmin, Users with Create Query Report permission
Contents
Create a user with login credentials.
Grant the necessary privileges to the user:
Database
To restrict postgres functions, remove the execute permission from the public role using Data Control Language (DCL) commands.
Use this
script to create a revoke function. After a revoke function is created, run the following query to remove execute permission for public users.
Run the following query to revoke execute permissions for functions from a read-only user.
Since revoke privileges can only be provided for public roles, you can restore public role privileges for users individually.
To restore revoke privileges for other users, provide execute permissions to all users except public and read-only users. Use this script
to create a grant function.
Execute the following query to fetch users.

Run the following query to grant public function privileges to other users. Replace <username> with users other than public or read-only users.
To verify if the restriction has been met, connect to the database as the newly created read-only user and ensure restricted queries are denied.
By default, certain words and tables are restricted to query. To fetch those keywords, use the following script:
Connect to the Microsoft SQL database as a user having the CREATE USER or LOGIN role.
Connect to the query console with the application database, and create a user with login credentials.
To achieve the required read-only privileges, use the following commands.
Restrict all other commands except SELECT.
The following command revokes the SELECT privileges for all tables.
To verify if the restriction has been met, log in to the database as the newly created user, run the following queries, and ensure the restricted tables are not queried.
If the query result shows a SQL table restriction message, the restriction of tables is achieved.
To restrict SQL functions, execute the following query.
For function like xp_cmdshel, execute the following
By default, some tables and words cannot be queried. Fetch those words using the following query.
Go to [ServiceDesk Plus Home]bin in the command prompt.
Execute the encrypt.bat file.
Type the Read-Only User password and press Enter.
Copy the password encryption key displayed in the command prompt and store it in a secure location.
Go to {SDP_Home}/ServiceDesk/conf.
Open the database_params.conf file.
Configure the username in the relevant tag. For example,
Fetch the encrypted password key and configure it in the relevant tag. For example,
After the user is created, connect the application to the database and execute the following query. This will allow the Read-Only User to create secure query reports that do not fetch data from the restricted tables: UPDATE ReportModuleConfiguration SET PARAMVALUE = 'true' WHERE CATEGORY LIKE 'ROUser' AND PARAMETER LIKE 'Use_ROUser'.
Restart the application for the changes to take effect.
1. Backup failures in bundled Postgres.
If a backup failure occurs due to permission issues, use this script
to restore necessary permissions for the application database users (sdpadmin).
2. In Microsoft SQL database, query report fails with the error message "Restricted table(s) found in query."