A separate permission to access Key authentication in user profile

Created on 1 February 2022, almost 3 years ago
Updated 16 August 2024, 4 months ago

It would be good to have the possibility to disallow users to access Key authentication and generate keys themself.
The key has to be generated by the administrator.

Feature request
Status

Needs review

Version

2.1

Component

Code

Created by

🇷🇺Russia kiseleva.t

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I found this issue for a bit different reason. On my website there are users with administer users permission. Yet I don't want them to manage the auth keys.

    Basically I need the following:

    -      $access = AccessResult::allowedIfHasPermission($current_user, 'administer users');
    +      $access = AccessResult::allowedIfHasPermissions($current_user, 'manage any auth keys']);
    

    If this sounds like a good idea, we could add an update hook that adds the new manage any auth keys permission to all users having administer users.

  • Either is fine for me, but I would like a permission like this added.

  • We should target the latest branch.

  • 🇮🇳India rajeshreeputra Pune

    Created 2.1.x branch updated the same in MR, Thank You!!

  • 🇦🇹Austria reinimax

    Thanks for the patch, this is a very useful feature indeed!

    However, I'm wondering whether it is a good idea to let any user with the "administer users" permission view the key authentication tab? Sure, they cannot edit the authentication key without the appropriate permission, but they can still see and potentially disclose or abuse this information.

    In my opinion, it would be better to remove the "administer users" permission from the access check in UserKeyAuthForm, so that access is only granted if the user has the appropriate permissions from the key_auth module. If a role who manages users needs to view the key authentication tab, they can simply be assigned an additional role.

  • First commit to issue fork.
  • 🇷🇸Serbia super_romeo Belgrade

    I added branch "3261708-a-separate-permission-" (please rename it to "3261708-a-separate-permission-without-administer-users") same to "3261708-a-separate-permission". MR18.

Production build 0.71.5 2024