OWASP/rbac — pull request #40 by Snooze- (2014-06-02 09:10:21+00:00)
Title: Added option to pass database through constructor

Some applications could benefit from the option of being able to define
the Rbac storage database programatically. This is true for applications
that that might switch between different Rbac rule sets, or applications
that have some centralised configuration mechanism (such as LDAP).

Database configuration that's normally stored in database.config, can be
passed to the Rbac class constructor as an array. The following array
keys are recognised, 'host', 'user', 'pass', 'dbname', 'adapter',
'tablePrefix'. All other keys will be ignored. Values are typecast to
strings.

It's important to note that even though this change allows you to load
rules dynamically, it *DOES NOT* allow you to have two different Rbac
instances at the same time, due to the extensive use of static members
in the Jf class. This should be the focus of a later patch.

The change is backward compatible, if no connection details are passed
to the constructor, it will fall back on the usuall database.config
file.