留言板

Edit role permissions in database ?

thumbnail
M. Garcia,修改在12 年前。

Edit role permissions in database ?

Regular Member 帖子: 107 加入日期: 11-5-17 最近的帖子
Hello,

We have to update an instance, adding a permission to a role : the "Add User" permission (Portal / General).
From the database structure, I understand that :
  • in the "permission_" table I should find something corresponding to this "Add User permission"
  • in the "roles_permissions" table I should find a tuple with my Role ID and the permission ID


But these tables are both empty. Why ?
If I add this permission from the control panel to the role I want, where is this stored ?


Thanks a lot =)
thumbnail
Thiago Leão Moreira,修改在12 年前。

RE: Edit role permissions in database ?

Liferay Legend 帖子: 1449 加入日期: 07-10-10 最近的帖子
Never change these tables directly. Use the API ResourceActionLocalServiceUtil and/or ResourcePermissionLocalServiceUtil to make your changes.
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: Edit role permissions in database ?

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
My tables aren't empty. I think you're missing something.

That said, should take Thiago advise of not modifying the database tables directly.
thumbnail
M. Garcia,修改在12 年前。

RE: Edit role permissions in database ?

Regular Member 帖子: 107 加入日期: 11-5-17 最近的帖子
Thanks Thiago and Hitoshi.

Those tables are empty for me in every Liferay instances I made (CE 6.0.6).

Do you mean NEVER modify any database table directly ?
If so, what delivering process should we use in case of configuration modifications ? (e.g. portletpreferences, which is quite often changed, and as for now we directly change de DB tables and remove all caches / temp / work).

What do you suggest we should do in case of adding a permission to a role in the remote instance (our client's instance) ?
We proceed deliveries, and as much as possible, we don't want the updates to be done by hand in the portal interface, but deploying WARs and running scripts (SQL/batch).

It worked well so far, modifying the DB : journalarticle content or portletpreferences preferences.

Thanks for the advice !
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: Edit role permissions in database ?

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
I usually just create a batch web service to modify the content.
thumbnail
Thiago Leão Moreira,修改在12 年前。

RE: Edit role permissions in database ?

Liferay Legend 帖子: 1449 加入日期: 07-10-10 最近的帖子
My suggestion is to NEVER change the database directly. Doing that you are transpassing all the business logic of the Liferay code and you can take your database to an inconsistent state.
thumbnail
M. Garcia,修改在12 年前。

RE: Edit role permissions in database ?

Regular Member 帖子: 107 加入日期: 11-5-17 最近的帖子
Ok, thanks guys =)

Hitoshi, could you please explain a bit more the delivery process with a batch web service ?

Thanks a lot.