Improve forbidden checks

New functions were created to check 'allowed' access because the previous design
was checking after changes were possibly made.

Changed the unit test to use an already created user to simulate the original
error that was reported.

Change-Id: I9f7e56a5afd9624070fffef6672ef88cd549f210
Closes-Bug: #1174451
Tests initialize database

Many tests (for example the backend_kvs tests) failed to run
individually. This is because the tests made the assumption that
because the system is configured for the KVS (or non-SQL) backend
that the database isn't required. The problem with this assumption
is that different backends can use different storage mechanisms,
and the credential backend only supports SQL. So any test that
requires that backends are loaded is required to initialize the
database.

Change-Id: I109b83bf512598952346bef01dc33c57802c7f60
Fix indentation errors found by Pep8 1.4.6+

As a preparation in order to switch to a newer
Pep8 version in the future, fix the indentation errors
that are missed by Pep8 1.4.5 due to bugs.

Change-Id: I19af0bdc9c3c9681a2bf60eb6d86f45c4fb11bc6
Closes-Bug: #1267994
Merge "Fix indentation errors found by Pep8 1.4.6+"
Merge "Improve forbidden checks"
Merge "Tests initialize database"