I'm writing a (pretty much) drop-in replacement for SimpleAuth, but I seem to be missing something.
Calling Auth::get_roles() throws an exception "BadMethodCallException [ Error ]: Invalid method: Auth\Auth::get_roles from Auth::__callStatic()."
Trying to investigate it, it seems that:
- calling Auth::login() works fine as it finds a login method in Auth_Login_MyAuth - calling Auth::member() work fine (due to 'member' existing in $_drivers?) - calling Auth::get_roles fails, as far as I can see because there is no 'get_roles' method in Auth_Login_MyAuth? (it is in Auth_Group_MyAuth)
Is 'drivers' like SimpleAuth? I just have the one 'MyAuth' (as far as I know! - can I check?). The Auth::login() and Auth::member() are working fine, so I suppose I just have the MyAuth driver? Thanks.
You can't call get_roles in the default Auth installation too.
A quick scan of the code reveals you can only call methods in the Login driver statically, as the methods are called on the Auth instance. The Group and ACL drivers are properties of the Login driver, and no separate instance in Auth.
To access methods in the Group driver (providing you have only one driver loaded), you can use