]> BookStack Code Mirror - bookstack/commit
Removed role 'name' field from database
authorDan Brown <redacted>
Tue, 4 Aug 2020 13:55:01 +0000 (14:55 +0100)
committerDan Brown <redacted>
Tue, 4 Aug 2020 13:55:01 +0000 (14:55 +0100)
commit5f1ee5fb0e8f9422650b380f8bdd7299618a99fa
tree08ce2f2e1be22209c6e41dd03c1ae40cad73a542
parenta9f02550f04deb941a1fb57bc1341309be8131e7
Removed role 'name' field from database

The 'name' field was really redundant and caused confusion in the
codebase, since the 'Display' name is often used and we have a
'system_name' for the admin and public role.

This fixes #2032, Where external auth group matching has confusing
behaviour as matching was done against the display_name, if no
external_auth field is set, but only roles with a match 'name' field
would be considered.

This also fixes and error where the role users migration, on role
delete, would not actually fire due to mis-matching http body keys.
Looks like this has been an issue from the start. Added some testing to
cover. Fixes #2211.

Also converted phpdoc to typehints in many areas of the reviewed code
during the above.
15 files changed:
app/Auth/Access/ExternalAuthService.php
app/Auth/Permissions/PermissionsRepo.php
app/Auth/Permissions/RolePermission.php
app/Auth/Role.php
app/Auth/User.php
app/Auth/UserRepo.php
app/Http/Controllers/PermissionController.php
app/Http/Controllers/UserController.php
database/migrations/2020_08_04_131052_remove_role_name_field.php [new file with mode: 0644]
resources/views/form/role-checkboxes.blade.php
resources/views/settings/index.blade.php
resources/views/settings/roles/delete.blade.php
tests/Auth/AuthTest.php
tests/Auth/LdapTest.php
tests/Permissions/RolesTest.php