Where does Magento's Admin Panel Navigation Rendering Hook into the ACL? - php

When you log into the Magento Admin Panel, you're only shown menu items that your role allows you to. Where in the Core does Magento check the user's role to determine which Navigation items should be shown? (I'm not interested in the _isAllowed method on Admin controllers, I'm interested in the Navigation rendering).
Also, as along as I'm here, outside of the aforementioned _isAllowed, navigation rendering, and SOAP/RPC API methods, what other parts of the Magento system rely on ACL?

Looks like Mage_Api_Model_Config and Mage_Admin_Model_Config are involved in the API and admin permissions respecively, they both have the methods
loadAclResources()
getAclAssert()
getAclPrivilegeSet()
Cheers,
JD

Found what I was looking for, but I'm still interested in other areas of the admin that use ACL resources.
Mage_Adminhtml_Block_Page_Menu::_checkAcl

Related

Centralising module settings and model administration

I have a module where I need to:
Manage Models
Manage Module Settings
API Authentication
Look & Feel
Etc
For Manage Models I obviously have a ModelAdmin extension
And for the latter Manage Module Settings I've had to create a DataExtension
Though this splits up the "Module Functionality" into two sections, ModelAdmin gets its own menu item on the sidebar, but the DataExtension only adds tabs to the Settings menu item.
I've searched around but to no avail on how to consolidate my custom tabs within the same menu item that ModelAdmin creates.
Is this possible? I understand the semantics behind ModelAdmin being that it only Administers Models but surely the functionality exists where you can add tabs to the menu item it creates that aren't models?
Surely it's not an abnormal scenario
The only way you could do this would be to extend LeftAndMain (as you have mentioned).
This can be a little daunting, but LeftAndMain is basically just a container for 3 templates:
Main admin template
Left hand nav template
Main edit form
At a basic level you can just create an extension to LeftAndMain, then add a custom "EditForm" function that has the settings fields you need (as well as actions to save the data).
Then if you want it to look fancier then you can overwrite the default LeftAndMain templates in framework/admin/tempaltes.
There are some docs on this on the Silverstripe site: https://docs.silverstripe.org/en/3.4/developer_guides/customising_the_admin_interface/cms_layout/
Hope that helps a bit.

Is it possible (and how to?) divide application to backend (admin part) and frontend (user part) parts?

I am developing web application, using zend framework 2. In my app, I want some modules. News, for example, users etc.
Is it possible, to divide whole application to two big parts: front-end (for users) and back-end (for admins).
In front-end there will be part of News module, which render news list, full news item etc.
In back-end there will be part of News module, which will render list of all news, tools for editing, deleting etc.
At the moment, I have simple structure:
I have MyZfcAdmin module, with routes configurated so, that when I am writing /admin/news/edit/5 it will call NewsController edit action with id 5 and render it. So now, I have all actions (for admins and for users) in one controller. Is it possible to create something like this:
module
frontend
News
SomeMoreModule
backend
News
SomeMoreModule
I found topic on google questions, in that suggested to use this CMS, but I want to try it by myself.
Different people have different idea in managing application, for me I will have news module that handle all news related calls both admin parts and user accessible parts. The idea you have described have some side effects like duplication of code between modules and crossing of borders between isolate modules like calling action in another modules(it's ok if there are related or fall in hierarchy), which may have issues in long term maintenance of the applications.
IMHO I might suggest you could create modules like News, users, etc where it can have combined functionality of both admin and user access. You can later include user authorization plug ins using bootstrap events and restrict action accessible by admin and other users
There is not concept of submodules inside any module. But you can give them proper naming conversations. If code is not formed in oops properly, then there can be code duplication into your project. As per #raj's answer, it's good to give restrictions based on user role. If any action is not intersecting admin and user role then you can separate those actions, but actions like add or edit news content are same for both role then you should point to same action by router.

Integrate non-admin page in sonata admin project

I need to put a non-admin page/view inside my admin project build using Sonata Admin Bundle. Is there a correct or standard way to integrate an independent page within the admin, make it accesible trough the dashboard or menu, and display it using the layout and all styles of the whole backend admin (including form styles)?
The only way I imagine how to do it is create a custom controller, an make the views use the same twig layout of the admin, but I think of it as a "brute force" way.
The way you stated seems the best one indeed. By taking a look at the dashboard page in the Admin, it is simply a controller rendering a template that extends the base_template of the sonata.admin.pool service.
You may then override the standard_layout.html.twig template to throughout the admin (don't forget to put it in the sonata_admin configuration as well) to customize the menus and add your link.

Completely custom Magento interface without shop

I have been searching but have not found much information on this. Would it be possible to completely override Magento's frontend interface? What I mean with this is completely remove the shopping cart, menu's, product listings, everything, and replace with a completely customized interface, which will not be used for a eCommerce portal.
I just found out that our customer does not in fact want a eCommerce solution, although we have built a lot of functionality on Magento and it would be a shame to have to re-write EVERYTHING on another platform and still build a ordering framework as well.
So my question is this, can you build a theme on Magento that only shows parts of the system completely unrelated to the actual 'shop' and where would I find information to figure out how to do this? I'd like to keep the custom frontend in Magento to easily re-use the product view blocks, etc. but Magento itself is not a system our client wants.
I have thought of an alternative where the Magento shop is merely placed in a sub-directory and used as a sort of 'engine' to run the eCommerce side of the system and building a completely different system which integrates with Magento, the downside of this of course being that we would have to rewrite completed work as well.
What would be the best route to follow?
Here is one way to go about it:
Edit the homepage via the backend and enter the following code in to it:
{{block type="catalog/product" template="page/homepage.phtml"}} this will allow you to display products on the page.
Make sure that when you enter the code you can see html markup (and not just the output)
Make a completely customized webpage showing whatever you want

Joomla! 2.5 - Implement custom table as plugin or module?

Just started developing with Joomla! (2.5), completely newb, read through the docs talking about Plugins, Components and Modules. Having a hard time figuring out which to choose and how to implement. I'd like to have a table similar to the one used in the Plugin Manager in the Joomla! administrator backend where the the results can be searched, filtered and even individual entries can be toggled (Enable/Disable by clicking on Status circle). Can someone point me to a tutorial or even some example code I can in developing this?
I’ve already read a few sites including this (http://www.inmotionhosting.com/support/website/joomla-25/plugin-vs-module-vs-component).
If you want to create page in administrator panel with tables, that display some items, you should develop joomla component.
Look for this: http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5
Note, that only components can provide extended administrator interface for managing some entries, create pages on font-end. Plugins intended only for processing output of components and modules. And modules intended only for display some html on specific positions in front-end template.

Categories