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

Command to set user as sysadmin does not work #79

Open
mboggess opened this issue Feb 13, 2017 · 8 comments
Open

Command to set user as sysadmin does not work #79

mboggess opened this issue Feb 13, 2017 · 8 comments
Assignees

Comments

@mboggess
Copy link

When trying to give a user sysadmin rights:
$ tcli user get sysadmin trident
no
$ tcli user set sysadmin trident true
Updated sysadmin
$ tcli user get sysadmin trident
no
$ tcli user set sysadmin trident yes
Updated sysadmin
$ tcli user get sysadmin trident
no

When trying to take away a user's sysadmin rights:
$ tcli user set sysadmin trident no
Value for sysadmin was already the requested value
$ tcli user set sysadmin trident false
Value for sysadmin was already the requested value

The help says:
$ tcli user set help
Help for user set
...
sysadmin <username> <sysadmin> System Administrator - Wether the user is a System Administrator

(Note: "Wether" should be "Whether".)

What does <sysadmin> mean? Is the tcli command expecting a boolean? A username?

@mboggess
Copy link
Author

And/or, and this would be preferable, so maybe a different ticket to be made, is there a way, currently, to obtain a list of system administrators and trust group admins?

@massar
Copy link
Member

massar commented Feb 16, 2017

Typos solved in tridentli/pitchfork#91 (pitchfork) -- to be merged.

@massar
Copy link
Member

massar commented Feb 16, 2017

Note that you should use 'tcli system swapadmin' first, you'll then be a sysadmin instead of a regular user and should be able to change permissions.

But there seems to be a catch in the swapadmin construct we added that is clashing with changing other user's permissions. Looking into it.

@massar
Copy link
Member

massar commented Feb 16, 2017

Should be addressed in the above patch; please await merging and release.

@mboggess
Copy link
Author

It isn't that the 'tcli system swapadmin' command does not work. I run 'tcli system swapadmin' and that gives permissions to run trust group, mailing list, etc commands. It's the 'tcli user set sysadmin' command that doesn't work (or I don't know how to use that specific command properly). Perhaps this merge fixes that, I just wanted to be clear about the problem we're experiencing.

@massar
Copy link
Member

massar commented Feb 16, 2017

It's the 'tcli user set sysadmin' command that doesn't work (or I don't know how to use that specific command properly).

You are using it correctly, but it is, as you found, broken, thanks for reporting.

Perhaps this merge fixes that, I just wanted to be clear about the problem we're experiencing.

Yep, that merge fixes your problem. It is awaiting review ;)

Apologies for being unclear; I should have written a bit more detail in the last comment.

In short summary: when we fetch a user, in pre-fix we would split the issysadmin/canbeadmin bit inside the user; but then when you fetch another user, that user would also be split and per default not have the issysadmin bit set even though it should have been. By moving the swapadmin logic into ctx where it belongs, this now is not an issue anymore as any fetched user actually matches the database contents.

The meat of the fix is:
tridentli/pitchfork@46db7e7

btw; this as there are a pile of items in review that build upon each other, hence the merge is larger than it should be.

@mboggess
Copy link
Author

Okay, got it! Thanks!

@mboggess
Copy link
Author

@massar, I know you said you guys have a whole pile of things to review. I see you have a pull request in, do you have a general estimate of when this fix will be merged in? Thanks!

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

No branches or pull requests

2 participants