PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

A.
Option A

B.
Option B

C.
Option C

D.
Option D

7 Comments on “Which code segment should you insert at line 02?

  1. Dan Anstis says:

    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.




    0



    0
  2. Jason Wilson says:

    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




    0



    0

Leave a Reply