Im working on a custom security plugin for one of my coldbox apps and
Im wondering if the plugin has access to the IOC beans.
For instance, I want to do something like the following in my plugin:
<cfset var UserService = getPlugin("ioc").getBean("UserService")>
This will allow the plugin to interact with my UserService functions
to pull user data for verifying logins and setting up my permission
Thanks in advance,
Yes, All plugins are part of the frameworkSuperType: http://coldboxframework.com/documents/cfdocs/content.cfm?file=C%3A%5CInetpub%5Cvhosts%5Ccoldboxframework%2Ecom%5Chttpdocs%5Cbuilds%5Ccoldbox%5F2%5F0%5F2%5Ccoldbox%5Csystem%5CframeworkSupertype%2Ecfc
So they receive that functionality. You can call it via getPlugin or via getController().getplugin()
Whatever you prefer.
The next version will also have Interceptors, which will be very cool for security plugin points. Once I get an alpha going on this, I’ll send it to you Russ.
Definitely! The interceptors sound cool for sure!
Thanks for the response Luis.