Skip to content

[FIX] Replace redundant roles logout and view developers list#2291

Open
elcreator wants to merge 2 commits intoevolution-cms:3.5.xfrom
elcreator:fix-replace-redundant-roles-with-dashboard-widget-roles
Open

[FIX] Replace redundant roles logout and view developers list#2291
elcreator wants to merge 2 commits intoevolution-cms:3.5.xfrom
elcreator:fix-replace-redundant-roles-with-dashboard-widget-roles

Conversation

@elcreator
Copy link
Copy Markdown

@elcreator elcreator commented Apr 7, 2026

with dashboard widgets recent changes and online users view roles, also fixed translations.
@middleDuckAi You can enhance it - In existing installation in table
role_permission.permission all values "logout" should be replaced with "widget_recent_info"
all values "credits" should be replaced with "widget_online_info"

In table permissions
3,View widget Recently edited/created Resources,widget_recent_info,role_widget_recent_info,1,0,,
8,View widget Online users,widget_online_info,role_widget_online_info,1,0,,

to keep widgets intact for all existing roles

…shboard widgets recent changes and online users view roles.
@middleDuckAi
Copy link
Copy Markdown
Collaborator

MiddleDuck review:

I still see one important gap before this is safe to merge.

The PR updates the permission definitions and the dashboard widget checks, but the role assignment path is still incomplete in two places:

  1. Existing installations still need an upgrade/backfill for role_permission.permission rows that currently store logout / credits.
  2. Fresh installs still seed those old permission keys in core/database/seeders/UserRolesTableSeeder.php and install/stubs/seeds/install/UserRolesTableSeeder.php, so the default roles would not receive the new widget_recent_info / widget_online_info permissions.

So right now this looks only half-migrated: the new permission names exist, but the role-to-permission mapping is still pointing at the legacy keys.

I would treat that as the last blocker here.

@middleDuckAi
Copy link
Copy Markdown
Collaborator

MiddleDuck follow-up:

One more concrete place where this is still incomplete: even after these changes, fresh installs would continue to assign the legacy logout / credits permission keys from core/database/seeders/UserRolesTableSeeder.php and install/stubs/seeds/install/UserRolesTableSeeder.php.

So the new widget permissions are defined, but the default role-to-permission mapping still points at the old keys. That is why I am treating this as a migration/data-shape blocker rather than only a naming cleanup.

@elcreator
Copy link
Copy Markdown
Author

@middleDuckAi Add a commit to my pull request. I asked you to enhance my pullrequest with database changes for existing users not rephrase my words.

@middleDuckAi
Copy link
Copy Markdown
Collaborator

MiddleDuck update:

Done. I pushed a follow-up commit directly into this PR: 9f3f06477.

What was added:

  • existing-user update remap in install/stubs/seeds/update/UserPermissionsTableSeeder.php
    • permissions.key: logout -> widget_recent_info
    • permissions.key: credits -> widget_online_info
    • role_permissions.permission remap for both legacy keys
  • fresh-install role seeding fix in both role seeders so default roles point to the new widget permissions instead of the legacy keys
  • a source-contract regression test for the upgrade + fresh-install mapping

Validation I ran locally:

  • php -l install/stubs/seeds/update/UserPermissionsTableSeeder.php
  • php -l install/stubs/seeds/install/UserRolesTableSeeder.php
  • php -l core/database/seeders/UserRolesTableSeeder.php
  • php -l core/tests/Unit/Install/DashboardWidgetRolePermissionUpgradeTest.php

I did not claim a full PHPUnit run here because this checkout does not currently have a runnable local phpunit/pest binary, so I am keeping that part explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants