1

I am developing a cloud storage component for joomla, where users(resellers) can create subusers in their directory.
I have implemented everything needed for the component, and I have created 2 main views for it:

  1. Cloud - where all the magic happens.

  2. Settings - where a user(if he can_manage_subcontainers - setting stored in database) can create sub-users for his directory.

They both work fine and are displaying on the menu, BUT:

  1. I want to always display the Cloud menu item.

  2. Display the Settings menu item only if the user is logged in and has permission to create new sub-users, and I want to make this from my component - to be template/version independent.

I can do it easy if I add a script to hide/display 2nd menu item after the user logged in and have permision, but i don't want to that.

I checked for a menu hook for joomla but nothing.

I have latest version of joomla and the component that I have created it's integrated with joomla framework on the admin side (made using Joomla functions) and the frontend(site part of component) its made in php as MVC from scratch.

Sorry for my bad english, hope you understand what I want. Thanks!

  • Hi @Razvan. Welcome to JSE. I changed your question's title and tried to correct a bit your question. Please see if the above corrections reflect your question. If I understood correctly, that's an interesting question. Although I am not at all sure that there is such a possibility. – FFrewin Jun 11 '15 at 16:46
  • Maybe you js solution, or at the other hand - I would suggest to not worry that much for this. Just create the required check in your view and give a message or a suggested action for the not authorized user. – FFrewin Jun 11 '15 at 16:49
1

Attach the permissions to the menu item. For a simple demonstration, set the "access" on the menu item to 'Registered' or 'Special' and you'll only see it if you fall into one of those categories. If you need finer-grained control, create an access group and only those users in that access group will be able to see it.

You probably could have used joomla's permission settings to control the can_manage_subcontainers ability in the first place, then this would have less of a manual component as you could set the same permissions on the menu item as you did for the subcontainers.

But as it is, it's a one-time-per-user set and forget kind of thing, so it may not be a hardship to manage it manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.