Which code segment should you insert at line 02?

You are modifying a web application so that it uses Azure Active Directory to manage users. You create a
security group named Users and a security group named Administrators. The Administrators security group is a
member of the Users security group.
You create the following code segment. Line numbers are included for reference only.

You need to implement the canAccessUserResources function.
Which code segment should you insert at line 02?

You are modifying a web application so that it uses Azure Active Directory to manage users. You create a
security group named Users and a security group named Administrators. The Administrators security group is a
member of the Users security group.
You create the following code segment. Line numbers are included for reference only.

You need to implement the canAccessUserResources function.
Which code segment should you insert at line 02?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 7

Your email address will not be published. Required fields are marked *


Radek

Radek

I would say D

Dan Anstis

Dan Anstis

The answer is B.

A: The code looks valid, and the logic looks sound. However the MemberOf property only returns direct group memberships, and the ‘Administrators’ group is nested under the ‘Users’ group.

B: The code looks valid and the logic looks sound. The isMemberOf function provides a transitive lookup of a user to a group.

C: The code is incorrect on line 1, as it attempts to lookup the groupID of the group ‘User’. The group in this question however is named ‘Users’.

D: The code looks valid, and the logic looks sound. However the Members property only returns direct group memberships, and the ‘Administrators’ group is nested under the ‘Users’ group.

Jason Wilson

Jason Wilson

Answer C is the only answer that will never return the desired result

Both A and D will return the correct result, but only if the user is directly a member of Users. If the user is a member of Administrators which is a member of users they will not show the user a member because they are not transitive.

Answer B is Correct
It returns where the user is a member of a group and is transitive.

https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/functions-and-actions#isMemberOf