New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permissions for the Contact module shown on /admin/config/people/permissions do not match the permissions shown on /admin/structure/contact/settings #6117
Comments
Confirmed on a vanilla demo site: Contact module permissions changed at (But permissions changed at |
I found out what is causing this issue. foreach ($roles as $role_name => $role) {
// Build arrays for checked boxes for each role.
if (in_array($perm, $role->permissions)) {
$status[$role_name][] = $perm;
}
} It shows a selected checkbox only when the permission has been assigned to the role.
foreach ($roles as $role_name => $role) {
// Builds arrays for checked boxes for each role. Always select the Admin
// role on new forms.
if (in_array($perm, $role->permissions) || ($role->name == $admin_role)) {
$status[$role_name][] = $perm;
}
} It shows a selected checkbox for the admin role, even when it does not have that permission. |
I can also confirm the problem (hardly ever use the Contact module). Seems like that code got copied over from Taxonomy, but that special handling for admin role is only needed for vocabs, where each one has its own set of permissions. And only when a new one gets created. And I can confirm, that the PR fixes it properly. 👍 Many thanks @kiamlaluno for finding and filing a PR. |
That explains why the comment said Always select the Admin role on new forms. |
Code reviewed, LGTM. |
Thanks @kiamlaluno, @olafgrabienski, @indigoxela, and @bugfolder! I merged backdrop/backdrop#4472 into 1.x and 1.26.x. |
/admin/config/people/permissions allows to change the permissions each roles have, including the permissions for the Contact module.
On /admin/structure/contact/settings, there is a Permissions fieldset that allows to change the Contact module's permissions each role has.
The permissions shown in those pages do not match: On /admin/config/people/permissions, the Administrator role does not have the Use the site-wide contact form, which I expressly removed, while on /admin/structure/contact/settings, that permission is still given after I removed it from /admin/config/people/permissions.
Steps to reproduce
Expected behavior
Since the permissions for the Contact module have been changed on /admin/config/people/permissions, the change should be reflected on /admin/structure/contact/settings.
The text was updated successfully, but these errors were encountered: