trident icon indicating copy to clipboard operation
trident copied to clipboard

Command to set user as sysadmin does not work

Open mboggess opened this issue 8 years ago • 8 comments

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 avatar Feb 13 '17 23:02 mboggess

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?

mboggess avatar Feb 14 '17 00:02 mboggess

Typos solved in https://github.com/tridentli/pitchfork/issues/91 (pitchfork) -- to be merged.

massar avatar Feb 16 '17 11:02 massar

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 avatar Feb 16 '17 12:02 massar

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

massar avatar Feb 16 '17 12:02 massar

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.

mboggess avatar Feb 16 '17 20:02 mboggess

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: https://github.com/tridentli/pitchfork/pull/93/commits/46db7e7d485d400280109c7d328c24ee47d2ead2

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.

massar avatar Feb 16 '17 21:02 massar

Okay, got it! Thanks!

mboggess avatar Feb 17 '17 15:02 mboggess

@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!

mboggess avatar Feb 27 '17 18:02 mboggess