-
Notifications
You must be signed in to change notification settings - Fork 317
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 'graph teams user remove' command capability solving #757 #761
Conversation
Awesome! I'll have a look shortly! |
Is it by design that you can't remove owners? Using the command I can remove members just fine, but when I try to remove someone who is an owner, I'm getting the following error:
|
Found the issue; what happens is that you cannot delete a owner using the same call as a member. There are two ways we can solve this:
The last option is the way it is implemented in PowerShell and has my preference. Let me know what implementation you think would fit best and I'll update the PR. |
Thanks for looking into it. It seems odd to me to have to specify the user role after you've already specified the user name. The user name by itself, followed by a confirmation, should be enough. I'd actually vote for option 1 where we detect the type of user and issue the correct call. |
@waldekmastykarz As requested; the call now retrieves all owners. If the passed user is an owner we execute the appropriate remove call, if the user is not an owner we assume its a member and execute that call. Let me know what you think |
Will have a look. Thanks! 👏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nicely done! 👏
let vorpal: Vorpal; | ||
let log: string[]; | ||
let cmdInstance: any; | ||
//let cmdInstanceLogSpy: sinon.SinonSpy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not ship commented out code
cb({ continue: false }); | ||
} | ||
}; | ||
//cmdInstanceLogSpy = sinon.spy(cmdInstance, 'log'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not ship commented out code
} | ||
|
||
public get description(): string { | ||
return 'Removes a specified user from the specified Microsoft Teams team'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...the specified user...
@@ -0,0 +1,43 @@ | |||
# graph teams user remove | |||
|
|||
Removes a specified user from the specified Microsoft Teams team |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...the specified user...
graph teams user remove --teamId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' | ||
``` | ||
|
||
Removes user from the specified team without confirmation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary indenting
Merged manually. Thank you! 👏 |
Add 'graph teams user remove' command capability solving #757