1. > map(“objsecurity”).to(“cfc.utilities.security”).into(this.SCOPES.NOSCOPE);
The __.into(this.SCOPES.NOSCOPE)__bit is unnecessary since that’s the default.
Good to know, thanks!
2. > can’t seem to get wirebox to play nice
Is this functionality that was working in ColdBox 3.x? There weren’t any significant changes to how WireBox works in ColdBox 4. Are any modules in play here?
Yes, this worked fine in Coldbox 3.x.
I do have an API module and a Relax module
3. > even trying to initialize it as the first step onApplicationStart()
What, what? What are you doing in onApplicationStart()? You shouldn’t need to do anything to initialize WireBox. ColdBox does all that for you.
I have application.wirebox = createObject(“component”,“coldbox.system.ioc.Injector”).init(“extensions.cb.config.WireBox”); as the first line of the onApplicationStart(). Is this not necessary?
- Where is your map().to() DSL? It should be in /config/WireBox.cfc.
It is.
- How are you requesting the objsecurity instance? (show us the code)
From the security handler:
public void function authorize(event, rc, prc) {
prc.title = “Check Authorization”;
local.objSecurity = wirebox.getInstance(“objsecurity”);
- Dump out wirebox.getBinder().getMappings() and see if your objsecurity mapping is in the list.
Here is that dump, placed in the function above:
struct
DSLDoc@relax
component coldbox.system.ioc.config.Mapping
METHODS
DSLService@relax
component coldbox.system.ioc.config.Mapping
METHODS
DataMarshaller@coldbox
component coldbox.system.ioc.config.Mapping
METHODS
HTMLHelper@coldbox
component coldbox.system.ioc.config.Mapping
METHODS
MSSQL_DAO@relaxlogs
component coldbox.system.ioc.config.Mapping
METHODS
MYSQL_DAO@relaxlogs
component coldbox.system.ioc.config.Mapping
METHODS
ORACLE_DAO@relaxlogs
component coldbox.system.ioc.config.Mapping
METHODS
ObjectMarshaller@coldbox
component coldbox.system.ioc.config.Mapping
METHODS
POSTGRES_DAO@relaxlogs
component coldbox.system.ioc.config.Mapping
METHODS
Relaxer@relax
component coldbox.system.ioc.config.Mapping
METHODS
Renderer@coldbox
component coldbox.system.ioc.config.Mapping
METHODS
XMLConverter@coldbox
component coldbox.system.ioc.config.Mapping
METHODS
coldbox.system.EventHandler
component coldbox.system.ioc.config.Mapping
METHODS
coldbox.system.Interceptor
component coldbox.system.ioc.config.Mapping
METHODS
hero.extensions.cb.handlers.Main
component coldbox.system.ioc.config.Mapping
METHODS
hero.extensions.cb.handlers.Security
component coldbox.system.ioc.config.Mapping
METHODS
interceptor-SES
component coldbox.system.ioc.config.Mapping
METHODS
interceptor-exception
component coldbox.system.ioc.config.Mapping
METHODS
interceptor-security
component coldbox.system.ioc.config.Mapping
METHODS
logService@relaxlogs
component coldbox.system.ioc.config.Mapping
METHODS
- Also note, I like to use the mapDirectory( ‘CFC’ ) method in the WireBox config to recursively map all the CFCs in a folder and its subfolders. Just add alias=“objsecurity” in the security.cfc to reference it by that name as well.
Thanks again!