RE: Theme Contributors Security

ALEX KEIL, modified 5 Years ago. New Member Posts: 23 Join Date: 5/23/19 Recent Posts
Hello all
I have created a theme contributor for my site, and the theming works. I'm using it mainly to theme individual portlets.
The thing is that only Admin users, or roles that have 'Permissions' access to the portlet are actually able to see the theme changes. Thing is i don't really want users to be able to access that section.
I've poured through the documentation on Theme Contributors and had a look for anything that allows a change in security but have come up short.
Any advise would be appreciated.
Thanks
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Themes have zero to do with security.

Use your theme to style stuff.

Use the portal's UI to alter permissions.
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
I'm using it mainly to theme individual portlets.
This sounds weird to me.
You should use the theme to do general styling. All styles that should be the same for all portlets should go to the theme (or maybe theme contributors). But styles that belong to a portlet should go into the portlet css. When you do that, users only get the css when they get the portlet.
Also: CSS has nothing to do with security. You can't rely on or use css to add security to your system. If you hide something with css, users can just use the developer console to unhide it.
Lee Jordan, modified 5 Years ago. Expert Posts: 449 Join Date: 5/26/15 Recent Posts
I never touch theme contributors. More trouble than it's worth.
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
You need to have the use case to make them worth it.

For example, if you have say 5 different themes you need to manage and make changes to, a single theme contributor that can be applied to all 5 starts to have a great deal of appeal to you.
Lee Jordan, modified 5 Years ago. Expert Posts: 449 Join Date: 5/26/15 Recent Posts
Yup and since having five themes would be a nightmare I always tried to use color schemes because the biggest reason for us to have different themes would be to provide different colors.
SASS makes theme contributor's redundant.
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Again, that is dependent upon your use case.  5 different themes because you are cohosting completely different organizations can make a different color scheme plan fall apart.

I'm not saying every solution deserves theme contributors, most can be handled with color schemes, theme parameterization, etc.  But for those cases that can take advantage of them, they can be a good fit.