Hide modules from current user in the navigation bar in Suitecrm - sugarcrm

I am right now using LDAP authentication for adding user in Suitecrm. In normal course when the user is added to the system we can assign him roles during creation and also hide some modules which are enabled for him, in his portal .
With LDAP authentication I have been able to assign user to a role through code when he first logins but hiding modules for those users by code or otherwise has not been possible
Can anyone guide me as to how to hide modules from the current user which otherwise show in the navigation bar?
Thanks in advance.

There is upgrade safe manner to do it via smarty file.
Check your active theme and copy the file from themes/<active_theme>/tpls/_headerModuleList.tpl to custom/themes/<active_theme>/tpls/_headerModuleList.tpl (if custom directory doesn't exist then create it)
Search for groupTabs, you will see foreach loops for processing it for different views. Hopefully, you can add your code there to do anything.

Related

Faveod Designer : How to hide items in navigation menu for which the user does not have permissions to access

So I have a resource (aka Maveoc) named Department that is configured as Visible in Menu.
In the generated app, the link to this resource/Maveoc is visible to all users, including those that do not have the permissions to access it.
From a security point of view, this is not a problem since it's not possible for the users to access that page.
It would be however nice to hide the link for the users that do not have access to it.
Any ideas on how to do this?
Thanks.
That's exactly what the boolean :check_access option in link_to_action does.
In graphical mode or if you specify a view's options, just check the checkbox.
Feel free to browse /macros_references in the Designer.
We know it's a tedious read for now: feedback is welcome,
and be sure that our V3 will have a much cleaner doc page.

Adding additional information to user accounts in Trac

For my Trac plugin, I would like to add a color (as string or rgb values) to each user for use from somewhere else in the plugin. The color should be configurable via the admin page.
Is it possible to add another column to the table in the Users settings of the AccountManagerPlugin panel, and if it is, how do I add the information to the database so I can access it from elsewhere?
Another option would be to make a new Admin Panel for my plugin, which is what I am currently doing, with a table with just the user names and their colors. But in this case, although I already have the empty admin panel, I don't know how to add the table and add new items to the database.
To explain what I need the colors for:
My plugin adds a new export option for tickets, and formats them with my own html and css structure. The tickets contain the owner's name, and this name should be displayed with their respective colors. The code for this already exists, now I just need to retrieve the colors from the database, and beforehand save them to the database via the admin panel.
The colors should be changable only via the admin page.
There's no Users admin panel in Trac, however the AccountManagerPlugin has a User management panel. Let me know if you are using the AccountManagerPlugin and I'll provide more info on that.
Keeping the discussion within the scope of Trac, you could implement the ability for the user to make a selection through a preference panel by implementing IPreferencePanelProvider. You could save the value in the session_attribute table and make use of it anywhere else. For an attribute named user_color, the value can be retrieved using req.session.get('user_color').
Examples can be found in trac.prefs.web_ui. I've linked to the code in Trac 1.1.6 because the module was refactored so that the preferences were more modular #9162.

Adding buttons to admin user list section of moodle

I need to add a button for each user in admin's user list (admin/user.php).
is it possible to do it from my local plugin? if yes how?
Or I need to edit the user modules manually?
The only way to do this without a core code modification, would be to use the theme (or possibly a local plugin) to inject some javascript into the page to add the button after the page has loaded.
The page itself is quite old, so it doesn't use a renderer, so overriding the generated HTML via the theme is not an option. The user actions aren't designed to be pluginable either.
Depending on what you are wanting to do, you could, of course, create a local plugin that adds a new link to the 'Site administration' tree. On the page this links to, you could add your own list of users, with whatever buttons you wanted on them.

Multiple layouts in zend framework

In my site I want two layouts.
Main layout comes when no login.
Whenever a user logs in there will be 1 more layout inside 1st with menu for account changes etc.
Can anyone explain how can we do it.?
If you just want to change the navigation for logged in/not logged in users, look into role privileges in zend_navigation_page
http://framework.zend.com/manual/en/zend.navigation.pages.html
Several options.
One is to use a pre-dispatch front controller plugin. Simply check Zend_Auth to see if user is logged in. If so, then set the layout to the 'logged-in' layout, else leave as default layout.
Another option is to check Zend_Auth from inside your actual layout file, and only include the additional code/formatting if they are logged in.

MODx removing content resource field

How do I hide the content resource field from non-admin users?
So you'd like a user to be able to change document fields such as title, alias etc but not the content?
You can not lock individual fields to admin user (as far as I know). You can either lock the whole page/resource or you could put the content that you want to be locked into the template for that document and lock the template to only the admin user which would achieve the same effect.
Make sure you don't have a reference to [+content+] in the template and even if the user enters document content it won't impact the page.
New answer instead of editing the above as this is a much cleaner solution.
Create different user groups eg. Admin & Editor
Make sure admin is in the admin user group
Create a template variable for your content and in the Access Permissions section only tick the admin group.
Assign the TV to your template.
Now if the user isn't in the admin user group the TV won't even be visible when they are editing the resource.
Hey, thanks for the answer.
I thought I'd post what I ended up doing.
With MODx Evo 1+, you have managermanager included. After removing the included file(which is used rather than the default chunk) using the rules in there I can rename hide and sync content.