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

Add properties: locksettings and nonewdevices #6000

Closed
Domkra opened this issue Apr 8, 2024 · 4 comments · Fixed by #6004
Closed

Add properties: locksettings and nonewdevices #6000

Domkra opened this issue Apr 8, 2024 · 4 comments · Fixed by #6004
Assignees

Comments

@Domkra
Copy link

Domkra commented Apr 8, 2024

Hi all
I work for a larger company and they want new users to get No New Devices and Lock Account Settings automatically when creating the user so that it looks like the picture.

image

Currently, I can only set the "No new device groups" and "No tools" permissions in the configuration file. This means that I would have to assign the no new devices and lock account settings permissions to each user who needs to use Meshcentral individually, which could be a lengthy process.

I was thinking of adding a change that would allow the following to be added to the configuration file

  "newAccountsRights": [
    "nonewgroups",
    "notools",
    "nonewdevices",
    "locksettings"
  ],

I had an idea and tried to implement it by adding the following lines to common.js.

    if (r == 'locksettings') { newAccRights |= 1024; }
    if (r == 'nonewdevices') { newAccRights |= 4096; }

image

After my changes, I was able to make this configuration in the configuration file.

would it be possible to apply this change permanently, because currently every update overwrites this change and you would have to adapt it again and again.

@si458
Copy link
Collaborator

si458 commented Apr 9, 2024

just looking at the source code,
the 'add agent' buttons can already be hidden IF the user isnt a siteadmin OR if the user has nonewdevices set.
if ((mesh.mtype == 2) && ((userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.siteadmin & 4096) == 0))) {
if ((currentMesh.mtype == 2) && ((userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.siteadmin & 4096) == 0))) {
might need to look into where these can be set as i cant find a UI?

@si458
Copy link
Collaborator

si458 commented Apr 9, 2024

sorry ive just re-read ur whole post!
you can already set newAccountsRights under domains

{
  "domains": {
    "" : {
      "newAccountsRights": ["nonewgroups","nonewdevices"]
    }
  }
}

@si458
Copy link
Collaborator

si458 commented Apr 9, 2024

OMFG sorry just re-read it again! you want the code to be added so it adds them 🤦
im having one of those weeks sorry...
ive also spotted i think the is some missing from the meshctrl.js as well!

@si458
Copy link
Collaborator

si458 commented Apr 9, 2024

all fixed for you! PR be merged into master soon!
dont forget to donate ❤️ or have a look at my amazon wish list! https://www.si458.co.uk/2024/01/05/donation/

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

Successfully merging a pull request may close this issue.

2 participants