Fórum

Liferay 6.0.6 Permission Handler Caching

Mitko Zafirovski, modificado 11 Anos atrás.

Liferay 6.0.6 Permission Handler Caching

Junior Member Postagens: 26 Data de Entrada: 01/03/12 Postagens Recentes
Hello all.

These days i've been playing around with the cache on liferay as i have two web apps that need to share the data. I have found out how to disable the entity level cache on some of liferays entites but the one thing that is bugging me is the permission handler. Ok in my portal.ext.properties i have the following lines.

value.object.finder.cache.enabled.com.liferay.portal.model.User=false
value.object.finder.cache.enabled.Users_Roles=false
value.object.entity.cache.enabled.com.liferay.portal.model.User=false
value.object.entity.cache.enabled.Users_Roles=false
value.object.entity.cache.enabled.com.liferay.portal.model.Layout=false
value.object.finder.cache.enabled.com.liferay.portal.model.Layout=false
value.object.finder.cache.enabled.com.liferay.portal.model.Role=false
value.object.entity.cache.enabled.com.liferay.portal.model.Role=false



And for example if in the data base i change a user to not be active the change is caught by liferay instantly. But for the permission is not the same. I also tested the folowing in one browser i open liferay with the Omniadmin user and in the control panel was searching for the user. When i change someing in the db and press refresh the roles shown for the user were changed, but still when the user logs in the permissions were the same. Can some one tell me if i need something other caching to disable?
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: Liferay 6.0.6 Permission Handler Caching

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
Mitko Zafirovski:
Can some one tell me if i need something other caching to disable?


Your mistake is updating the database directly.

If you invoked the Liferay API to make these changes, you would not need to mess with the cache and the permissions would be updated correctly.

The Liferay database should, at all times, be treated like a black box. You do not own the tables/values/etc in the database, Liferay does.
Mitko Zafirovski, modificado 11 Anos atrás.

RE: Liferay 6.0.6 Permission Handler Caching

Junior Member Postagens: 26 Data de Entrada: 01/03/12 Postagens Recentes
I know that database should not be updated directly i was using that just as an example. I need the permission checker not to cache the roles because i am changing the roles from a different web app. I was asking if there is a way to disable the permission checker cache the same way i managed to disable the role and user entity cache?
thumbnail
Hitoshi Ozawa, modificado 11 Anos atrás.

RE: Liferay 6.0.6 Permission Handler Caching

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
I was asking if there is a way to disable the permission checker cache the same way i managed to disable the role and user entity cache?


I don't think you really want to do this because liferay checks permission on every asset each time. Disabling the cache would really slows down your liferay - liferay depends on cache for performance.
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: Liferay 6.0.6 Permission Handler Caching

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
Mitko Zafirovski:
I know that database should not be updated directly i was using that just as an example. I need the permission checker not to cache the roles because i am changing the roles from a different web app. I was asking if there is a way to disable the permission checker cache the same way i managed to disable the role and user entity cache?


Again, you should be using the Liferay API and not updating the database directly. In this case your other web app should be invoking the Liferay web services to update the user roles. Using the API will ensure that the cache is updated appropriately.
Mitko Zafirovski, modificado 11 Anos atrás.

RE: Liferay 6.0.6 Permission Handler Caching

Junior Member Postagens: 26 Data de Entrada: 01/03/12 Postagens Recentes
Guys thanks for replaying and tell me why i should not disable the caching. But i already know all the reasons why not to disable the cache and still i need to because of things i am not in liberty to disclose on this forum. I know that is very bad to do that and i know what am i doing atm. I was just simply asking how can i disable the permission caching. If u know the answer please share it with me. If not thanks for the advice you have given me so far.
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: Liferay 6.0.6 Permission Handler Caching

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
The answer I'm giving has nothing to do w/ caching vs not caching.

It is simply one of the golden rules of Liferay - do not access the database directly, always use the Liferay API.

Whether it's a caching issue, an indexing issue, some sort of database upgrade issue, doesn't really matter. Any time you access the database directly you break the Liferay API contract, and when you break the contract you're bound to have issues. Right now you know about the caching thing because that's as far as you've gotten, but there could be many other things that are potentially not working that you haven't stumbled upon yet.

We're not saying "don't disable the cache" or not providing the info because we're trying to hide anything. We're saying that, from our experience, any time you hit the database directly things just don't work the way you'd expect, and therefore it should be avoided.

Liferay provides a full web service for many of their APIs, and you can use the client jar to leverage those calls. Most of the heavy lifting has already been done, you just have the integration stuff to worry about.
Jan Tošovský, modificado 9 Anos atrás.

RE: Liferay 6.0.6 Permission Handler Caching

Liferay Master Postagens: 565 Data de Entrada: 22/07/10 Postagens Recentes
Dear Mitko,

have you found any solution? In my case I use Liferay API, but assigning the role to the user doesn't refresh permissions immediately so he cannot access a specific MB category content immediately (but it works after several minutes). I think some kind of permissionChecker reload would help here, but I can't find such a method.

Thanks, Jan