Viewing a User's or Role's Permissions
View system permissions and object permissions of a user.
Procedure
- Log in to FusionInsight Manager, choose Cluster > Services > MOTService, click Instance, and view and record the service IP address of the MOTServer(Active) instance.
- Log in to the active MOTService node as user omm and run the following command to start environment variables:
source ${MOTSERVER_HOME}/.motservice_profile
- Run the following command to connect to the MOTService database and enter the password of user omm:
gsql -d postgres -p 20105
Contact the system administrator to obtain the password of user omm for the MOTService database.
- View system permissions of the user.
For example, to view the system permissions of the user joe, run the following command:
\du joe
The command output is as follows:
List of roles Role name | Attributes | Member of -----------+------------+----------- joe | Create DB | {}
Create DB indicates that user joe has the permission to create a database.
- View object permissions of the user.
Run the following command to switch to user joe:
SET ROLE joe password "password";
If the following information is displayed, the switching is successful:
SET
Run the following command to create the database music1:
CREATE DATABASE music1;
Query existing databases.
postgres=> \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ----------------+----------+-----------+---------+-------+----------------------- music1 | joe | SQL_ASCII | C | C | postgres | omm | SQL_ASCII | C | C | template0 | omm | SQL_ASCII | C | C | =c/omm + | | | | | omm=CTc/omm template1 | omm | SQL_ASCII | C | C | =c/omm + | | | | | omm=CTc/omm (5 rows)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot