Search code examples
liferayhookliferay-6liferay-themeliferay-aui

How to hide site membership option for site owner/admin in liferay


I have created a separate module for creating and assigning users for site admin/owners. So I don't want to show the "Site Membership" option under Users tab for both Site admin and owner.

  • How can I hide the Site Membership option?
  • Is there any way that the permission or configuration will do the required change? Or do I need to create the hook?

Any suggestions please?

enter image description here


Solution

  • Rather than changing the semantics of Liferay's built-in roles, rather introduce your own custom roles and define the permissions that you want them to have. Create a "site role", choose "Define Permissions" and add what you need.

    From your comment I understand that you want to use Site Admin, just not with everything this role comes with. It sounds strange to me that you're demanding a certain solution and favor one that doesn't work, but so be it.

    You can check if it's possible to remove some permissions from the "Site Admin" role, but I'd expect a very hard-to-maintain-system resulting from this. Liferay has no means of "maintaining only the users that a certain Administrator has created". What you can do is: An Organization Administrator can administer all users in the organizations they're administering. This might be another solution for you.

    Or alternatively, implement your own UI and do your custom (non-Liferay-based) permission checks in it. This UI will then enable your custom admins to administer the users that the UI provides for them.

    But if you're stuck to a certain solution, you might be out of luck. Give us more details of your problem and we might come up with a solution unless you insist that your solution is the way to go.