Reputation: 1
In Liferay 7.1, I am looking for an SQL script that show me what permissions have every user.
This is for Liferay 7.1, I looked for information about this, and I get just solutions for liferay 6.2 or less. I understood that every role has permission and these permissions are stored on the table ResourcePermission.
I need something like this. user role permission query But for liferay 7.1.
What we need is the list of permission of every role or user has and what action the user is able to.
UPDATE:
I created a scrip where I can see the permission for layouts,
SELECT layout.friendlyurl, role_.name ,resourcepermission.actionids
FROM layout
INNER JOIN resourcepermission
ON layout.plid LIKE resourcepermission.primkey
LEFT JOIN ResourceAction
ON ResourcePermission.actionIds = ResourceAction.resourceActionId
JOIN role_
ON role_.roleid LIKE resourcepermission.roleid
ORDER BY layout.friendlyurl , resourcepermission.roleid, ResourceAction.actionId
Now I am stock on how can I know what action is the id on the list, there is no table call actions, seems to have relation with ResourceAction table
UPDATE 2:
I found this article that explain the role permissions in Liferay
https://liferay.dev/blogs/-/blogs/deep-dive-in-roles-and-permissions
Upvotes: 0
Views: 661
Reputation: 48087
The more you read about Liferay's database structure, the more you'll realize that you don't want to understand the details of how it's stored in the backend. You'll only be tempted to change something in the backend, and in the process ruin your upgrade path. Trust me: Been there, done that, and more importantly: Seen that.
That being said: Permissions and such a table aren't that simple: Liferay grants some permissions by site, some by organization, some globally across everything, and some by team association. And some other permissions are granted by object (e.g. you might generally be forbidden to write articles, but allowed to edit a specific one)
Further more: The permissions are stored so that they can be easily queried for permission checks, but not for visualization. I doubt that you'll find a reasonably understandable solution in SQL and would rather recommend you go by API, iterate through the different roles and create various visualizations, e.g. for each role, for each user, for user associations with user groups, sites, organizations.
Alternatively, if you think you already had such a solution for 6.2 and need help to port it to 7.1: Post it. Maybe someone understands enough of the structure that they can point out where the query doesn't do what you expect it does.
Upvotes: 0