NethServer / nethsecurity

NethSecurity image and build environment
https://www.nethsecurity.org/
Other
98 stars 6 forks source link

Expose admin users #575

Closed gsanchietti closed 3 months ago

gsanchietti commented 4 months ago

A local user inside the users database can be converted to a local admin using the ns.users set-admin API.

To revoke the admin access, use the ns.users remove-admin API.

‌ Expose the function inside the User database page.

gsanchietti commented 3 months ago

Testing image: 8-23.05.3-ns.1.0.1-10-g168db29

stephdl commented 3 months ago

QA

use the test image go to the user vpn database create a user you can set it admin and disabled it if needed from the neDrawer or from the table (list of users)

the changes must be propagated or read from the CLI

echo '{ "database": "main"}' | /usr/libexec/rpcd/ns.users call list-users | jq

cotosso commented 3 months ago

It works as expected

root@NethSec:~# echo '{ "database": "main"}' |  /usr/libexec/rpcd/ns.users call list-users | jq
{
  "users": [
    {
      "local": true,
      "database": "main",
      "name": "davide",
      "password": "$6$856dcb83e49581c3$R8dtJEEeOOdtr9Bvx0W5P0ub3C8OYNyY.xGoRTTdq3cB8Ghub0c8hNx2tN1myWDvelRGXvKlELLWLvFYiBfdz1",
      "description": "davide",
      "admin": true,
      "id": "ns_0fdab136"
    }