Skip to content
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

Is it superuser or admin? #1108

Open
mehov opened this issue Dec 7, 2024 · 0 comments
Open

Is it superuser or admin? #1108

mehov opened this issue Dec 7, 2024 · 0 comments

Comments

@mehov
Copy link

mehov commented Dec 7, 2024

Is there a difference between superuser and admin?

public const ROLE_USER = 'user';
public const ROLE_ADMIN = 'admin';

$this->_createUser($args, $io, [
'username' => 'superadmin',
'role' => 'superuser',
'is_superuser' => true,
]);

If not, it will probably be more consistent if UsersAddSuperuserCommand reuses the role defined in UsersTable instead of hardcoding superuser. This way we can always read whatever the super-user-admin role name is by calling \CakeDC\Users\Model\Table\UsersTable::ROLE_ADMIN.

UPDATE: Code search says that ROLE_ADMIN is not being used anywhere inside this plugin.

UPDATE According to blame, ROLE_ADMIN originates in ebe0114. Searching ROLE_ though commit source shows only 2 matches where the two constants are introduced, doesn't show any usage.

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

No branches or pull requests

1 participant