RE: Custom permissions checker in Liferay 7

Enrico Costanzi, modified 8 Years ago. New Member Posts: 21 Join Date: 2/11/17 Recent Posts
Is it possible to provide a Permissions Checker via osgi bundle?


With Liferay 6.2 we managed to use a different permissions checker by deploying an ext plugin.
The in portal-ext.properties we inserted the property
permissions.checker=com.example.MyPermissionsChecker
and everything worked fine.

With Liferay7 we weren't able to provide a permissions checker via OSGI, so we ended up copying the bundle into the WEB-INF/lib of the ROOT app.
I hope there's a different way to achieve this, otherwise I don't get the choice of exclude the ext plugins from Liferay 7.
I've heard that they will be reintroduced, but still, if there are custom classes as portal property values, how were these properties supposed be used prior to the GA4?

Don't mean to be rude or criticize, just pointing out few doubts emoticon
thumbnail
David H Nebinger, modified 8 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
No, you can't currently define the permission checker in an OSGi bundle. Rather than copying the lib in manually, though, this is actually a job for the EXT plugin which should be returning in GA4.









Come meet me at the 2017 LSNA!
Noel Abi Abdallah, modified 5 Years ago. New Member Posts: 2 Join Date: 1/22/20 Recent Posts
Hi, do we still have this limitation in the latest version 7.2.0 GA2 ? 
thumbnail
Tomas Polesovsky, modified 5 Years ago. Liferay Master Posts: 677 Join Date: 2/13/09 Recent Posts
Works in 7.0 too. Just register a new PermissionCheckerFactory to create the custom permissions checker instances. 

​​​​​​​See https://github.com/liferay/liferay-portal/blob/7.0.x/modules/apps/web-experience/staging/staging-security/src/main/java/com/liferay/staging/security/internal/permission/StagingPermissionCheckerFactory.java