Forums de discussion

Resource Block Permissions

Fabio Pezzutto, modifié il y a 6 années.

Resource Block Permissions

New Member Publications: 10 Date d'inscription: 22/10/10 Publications récentes
Hi,

starting form version 6.2, Liferay has introduced a new way to store the permissions: the ResouceBlockPermissions. Compared to default ResoucePermissions, it reduces the number of db table rows to archive the resource-role-actions informations .
This blog post explain the differences and how use it: https://web.liferay.com/web/sampsa.sohlman/blog/-/blogs/not-so-well-known-feature-resourceblock-permissions
Currently there are just two portal core entities the use the ResourceBlockPermission, Calendar and Bookmarks, but it is very straightforward for developers creates his own custom entities and use this new way to store permissions.

According with Sampsa's blog post, ResourceBlockPermissions is much faster during reading operations but is seems to be a bit more slow during writes.

From our experience, the ResourceBlockPermissions works fine and we used it for our custom entities. The only drawback is the update of an role defined permissions, it has to update the hash of every resourceBlock (https://github.com/liferay/liferay-portal/blob/c83d177f921b9ebad1b2a13730fddfcf9fb1ba81/portal-impl/src/com/liferay/portal/service/impl/ResourceBlockLocalServiceImpl.java#L1079) and if you have many entity entries (for example more than 100k) it can easily takes hours.
I don't know if consider it a bug or and design side-effect.

Has any some other experienced this situation?

Fabio.
thumbnail
Andrew Jardine, modifié il y a 6 années.

RE: Resource Block Permissions

Liferay Legend Publications: 2416 Date d'inscription: 22/12/10 Publications récentes
Hi Fabio,

I haven't experienced this one -- but I also haven't tried it with such a large number of entities. Even if it were considered a bug, the maintenance for the CE edition of 6.2 is done now so your only change to get a patch is if you have an EE license, or you are willing to do it yourself via EXT plugin. If you do decide to patch it yourself, it'd be great if you could provide your solution here so that others can benefit from it.

I wonder though if the issue persists in 7. Have you tried to reproduce with the latest 7.0 GA4?
thumbnail
Olaf Kock, modifié il y a 6 années.

RE: Resource Block Permissions

Liferay Legend Publications: 6396 Date d'inscription: 23/09/08 Publications récentes
Fabio Pezzutto:
From our experience, the ResourceBlockPermissions works fine and we used it for our custom entities. The only drawback is the update of an role defined permissions, it has to update the hash of every resourceBlock (https://github.com/liferay/liferay-portal/blob/c83d177f921b9ebad1b2a13730fddfcf9fb1ba81/portal-impl/src/com/liferay/portal/service/impl/ResourceBlockLocalServiceImpl.java#L1079) and if you have many entity entries (for example more than 100k) it can easily takes hours.
I don't know if consider it a bug or and design side-effect.


You might want to chime in on this, as they seem to go away.
thumbnail
Andrew Jardine, modifié il y a 6 années.

RE: Resource Block Permissions

Liferay Legend Publications: 2416 Date d'inscription: 22/12/10 Publications récentes
Yikes!

@Olaf, I thought this feature had originally been added as an improvement to reduce the overall number of (repetitious) records? From what I remember reading, it was supposed to be a performance improvement. Now I realize that, as the original post reported, it seems to lose it's worth on the higher end of the spectrum, but wouldn't REMOVING this feature just create a performance issue at he LOWER end of the spectrum?
thumbnail
Olaf Kock, modifié il y a 6 années.

RE: Resource Block Permissions

Liferay Legend Publications: 6396 Date d'inscription: 23/09/08 Publications récentes
Well, I thought so too. But frankly, I don't know more about the decision process on why and when it should go away, or what it will be replaced with. I'm just bringing you the message as I've seen this passing by on my radar.