Microsoft Tech Community Live:  Microsoft Teams Edition
November 09, 2021, 08:00 AM - 12:00 PM (PST)

Using userTeamRole is not working

%3CLINGO-SUB%20id%3D%22lingo-sub-2121425%22%20slang%3D%22en-US%22%3EUsing%20userTeamRole%20is%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2121425%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EWe%20are%20developing%20a%20teams%20app%20and%20we%20are%20trying%20to%20get%20the%20user%20role%20in%20order%20to%20distinguish%20between%20regular%20user%20and%20administrators.%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20call%26nbsp%3BmicrosoftTeams%20sdk%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EmicrosoftTeams.getContext(function(context)%26nbsp%3B%7B%3CBR%20%2F%3Evar%20role%20%3D%20context.userTeamRole%3B%3CBR%20%2F%3E%7D)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20issue%20is%20that%20the%20userTeamRole%20returns%20undefined%20and%20it%20seems%20the%20context%20does%20not%20include%20this%20information.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20we%20need%20to%20define%20something%20in%20order%20to%20get%20it%3F%3C%2FP%3E%3CP%3EIs%20there%20an%20alternative%20way%20to%20know%20if%20the%20user%20is%20administrator%20or%20not%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ERonny%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2121425%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hello,

We are developing a teams app and we are trying to get the user role in order to distinguish between regular user and administrators. 

We call microsoftTeams sdk as follows:

 

microsoftTeams.getContext(function(context) {
var role = context.userTeamRole;
});

 

The issue is that the userTeamRole returns undefined and it seems the context does not include this information.

 

Do we need to define something in order to get it?

Is there an alternative way to know if the user is administrator or not?

 

Thanks,

Ronny

2 Replies
Anything so far? I have the same problem with static tabs

Unfortunately no.