Welcome to Headwind MDM Q&A, where you can ask questions and receive answers from other members of the community.

Please do not post bug reports, missing feature requests, or demo inquiries. If you have such an inquiry, submit a contact form.

0 votes

Our Scenario:
I'd like to use the Logs plugin for our app.

1. app sends logs to server with MDMService.Log.
2. System Operator view the logs on web-panel.

Problem:
It looks like we need admin role to view the logs

Question:
Can I view the logs without admin role?

by

1 Answer

0 votes

You can tune the user permissions, however it is not (yet) included in the user interface. You need to update values in the Headwind MDM database.

From the command line, run the following commands (as root):

# su postgres

# psql hmdm

Or find login and password to access the database in the XML configuration (/var/lib/tomcat8/conf/Catalina/localhost/ROOT.xml), and connect to the database by running the command

# psql hmdm -U (username)

In the PostgreSQL shell, find the list of permissions:

# SELECT id, name FROM permissions;

You will see a permission with id=110 and name='plugin_devicelog_access'. 

Then look into the list of roles:

# SELECT id, name FROM userroles;

You will see that a user role 'User' has id=3.

Insert the corresponding relation in the table of user role permissions:

# INSERT INTO userrolepermissions(roleId, permissionId) VALUES (3, 110);

Logout from the web panel and re-login. You must see the logs!

To revoke a permission, use the DELETE command:

DELETE FROM userrolepermissions WHERE roleid=3 AND permissionid=110;

by (37.6k points)
edited by
If you need to create a new role, for example "Manager", do the following:

INSERT INTO userroles VALUES (4, 'Manager', 'description', 'f');

The role has been created, next we need to add the necessary permissions to this role from the list of permissions.

INSERT INTO userrolepermissions(roleId, permissionId) VALUES (4, 115);
INSERT INTO userrolepermissions(roleId, permissionId) VALUES (4, 121);
....
INSERT INTO userrolepermissions(roleId, permissionId) VALUES (4, 108);

After the necessary permissions are added logout from the web panel and re-login.
...