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

Feature Request: Implement support for setting default groups #17

Open
JoshStrobl opened this issue Mar 16, 2019 · 16 comments
Open

Feature Request: Implement support for setting default groups #17

JoshStrobl opened this issue Mar 16, 2019 · 16 comments

Comments

@JoshStrobl
Copy link

In my opinion, most end users which decide to utilize user-admin as a replacement for gnome-system-tools are likely to not be technically adept enough to know which specific groups should be set by default for a new user. Their usecase is likely centered around creating another "standard" user (without specified admin group(s)) or an administrative-type user (with the admin_group from group-service, most likely).

I'd like to request a compile-time configuration flag (either in this repo or group-service, I'm happy to file a request over there too) to set default groups in which new users should be set.

This would be especially useful since most end users are not likely to know what specific groups their own account has been set up with, for example on Solus you could expect groups such as:

  • audio
  • cdrom
  • fuse
  • lpadmin
  • plugdev
  • scanner
  • users
  • video

With the administrative account being in the sudo group. This could ideally be set with a flag such as -Ddefault_user_groups=audio,cdrom,fuse,etc... either in user-admin or group-service.

@zhuyaliang
Copy link
Owner

@JoshStrobl
That's a good idea. But I think it would be more perfect to design an interactive graphical interface, such as:
An advanced button can be added to the window where a new user is created. When the user clicks on the button, the default add group can be set.But will this be the same as what group management provides function?

@kyrios123
Copy link
Contributor

kyrios123 commented Apr 24, 2019

This would indeed make the application more convenient for non technical users (and even for advanced users actually) as it allows to have sane defaults.
If you don't want to set the default groups at build time, there could maybe be defined in a properties file that each distribution could ship with the application to set their defaults ?

@zhuyaliang have you decided on what could be the best approach for this already? (I'd really have to have this feature implemented so the application can be added in our repository)

@zhuyaliang
Copy link
Owner

@kyrios123 I've done this, and I load the default settings for new users by reading configuration files. I'm currently testing。The configuration file looks like this

# /etc/mate-user-admin/nuconfig 
# Default configuration for new users 
[nudefault]
#Default language for new users
nulanguage = en_US.utf8

#Default Type for New User, 0 Ordinary User 1 Manage User
nutype = 0    

#Default Add Groups for New Users
nugroups =mail;audio;video;lightdm

@kyrios123
Copy link
Contributor

kyrios123 commented Jun 12, 2019

@zhuyaliang Thanks!
nugroups and nutype are working fine but the language field of newly created users is set to No Settings on main screen although nulanguage is set to en_US.utf8 , is this normal ?

PS: Would it be possible to also add default groups for Administrators ? I agree it's not as important as for Standard users, but it's convenient.

@zhuyaliang
Copy link
Owner

@kyrios123 For language ineffectiveness, you can check the /tmp/ log-(timestamp) log to see if there are useful messages. Set nutype to 1, and the new user created is the administrator type,nugroups is his default group (administrator)

@kyrios123
Copy link
Contributor

Unfortunately logs don't show anything useful. I just created a new user (Admin Test) then I clicked on it.
image

What I meant regarding the default groups for the Administrators is that perhaps it would be a good idea to have the possibility to provide default groups for new Standard accounts and for Administrators. For example for some reasons, I may want newly created Administrators to be member of the wheel group but not Standard accounts. Currently you can just specify default groups but they are the same regardless if the account is Standard or Administrator.

@zhuyaliang
Copy link
Owner

@kyrios123 Thank you for your test. I'll solve this problem.But it needs your cooperation, because I don't have the problem of language setup failure here.

@kyrios123
Copy link
Contributor

sure, just let me know what I should do!

@zhuyaliang
Copy link
Owner

@kyrios123
I added some debugging information,The generated log (/ TMP / log*) is sent to me after compilation and run, so I can analyze the cause of the problem.
What would happen if you set up other languages in the configuration file?
Can Manual Language Settings Succeed?

@kyrios123
Copy link
Contributor

Here are the logs, although it says "English (United States)", on the Screen it displays "No Setttings".

level:[Info]  message: mate-user-admin user 1
level:[Info]  message: mate-user-admin Current user name Pierre-Yves
level:[Debug]  message: nuLang = en_US.utf8
level:[Debug]  message: NewUserlang = English (United States)
level:[Debug]  message: username testuser realname Test User usertype 1 langname English (United States) passwod 1
level:[Info]  message: mate-user-admin Current user name Pierre-Yves
level:[Info]  message: mate-user-admin Current user name Test User
level:[Debug]  message: nuLang = en_US.utf8
level:[Debug]  message: NewUserlang = English (United States)
level:[Debug]  message: username testuser2 realname Test User II usertype 1 langname English (United States) passwod 1

Here are the logs. I found some more bugs

  1. Application crashes when creating 2 new users in a row
  2. When you set a language to a user then navigate on other users, it keeps on showing the language that was set on all users (like if the field is not refreshed/reloaded), but it correctly sets the language on the user.

@zhuyaliang
Copy link
Owner

@kyrios123 I solved the problem of language.

Application crashes when creating 2 new users in a row

I haven't encountered such a situation. Is there any error message if you start-up from the command line?

@kyrios123
Copy link
Contributor

@zhuyaliang I confirm the language problem is solved :)
I'll open another issue for the crash.

To get back to the original topic, what about the suggestion of having the possibility to set default groups for "Standard Users" and to set different default groups for "Administrtors" ?

@zhuyaliang
Copy link
Owner

@kyrios123 Any questions?

@kyrios123
Copy link
Contributor

Hi @zhuyaliang I still would love to see a setting similar to nugroups but for setting default groups for Admin users
That would be a nice enhancement imho

@zhuyaliang
Copy link
Owner

OK, I will change the /etc/mate-user-admin/nuconfig configuration file to add new options

administrator user group
standard user group

@zhuyaliang
Copy link
Owner

@kyrios123
Try this commit, adding default groups for different types of users
7011404a
This is the modified configuration file

#Default Add Groups for New Users (Administrtors)
nuadmingroups =mail;audio;video;lightdm
#Default Add Groups for New Users (Standard)
nustandgroups =mail;audio;video;cdrom;sshd

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

3 participants