exam questions

Exam AZ-203 All Questions

View all questions & answers for the AZ-203 exam

Exam AZ-203 topic 2 question 7 discussion

Actual exam question from Microsoft's AZ-203
Question #: 7
Topic #: 2
[All AZ-203 Questions]

DRAG DROP -
You are developing a .NET Core model-view controller (MVC) application hosted on Azure for a health care system that allows providers access to their information.
You develop the following code:

You define a role named SysAdmin.
You need to ensure that the application meets the following authorization requirements:
✑ Allow the ProviderAdmin and SysAdmin roles access to the Partner controller regardless of whether the user holds an editor claim of partner.
✑ Limit access to the Manage action of the controller to users with an editor claim of partner who are also members of the SysAdmin role.
How should you complete the code? To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer: Explanation
Box 1:
Allow the ProviderAdmin and SysAdmin roles access to the Partner controller regardless of whether the user holds an editor claim of partner.
Box 2:
Limit access to the Manage action of the controller to users with an editor claim of partner who are also members of the SysAdmin role.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
JaQua
Highly Voted 5 years, 2 months ago
correct answer is: 1. [Authorize(Role="SysAdmin, ProviderAdmin")] 2. [Authorize(Policy="ProviderPartner")] [Authorize(Role="SysAdmin")]
upvoted 42 times
igorcode
5 years, 2 months ago
There is no ProviderPartner.. your answer is wrong.
upvoted 1 times
chaudh
4 years, 10 months ago
No, [Authorize(Role="SysAdmin, ProviderAdmin")] is not provided in question [Authorize(Role="SysAdmin", "ProviderAdmin")] is provided in question.
upvoted 2 times
bhushan_786
4 years, 5 months ago
It is a typo from him while writing the answer. Look like his answer is correct.
upvoted 1 times
...
...
...
chintan4190
5 years, 1 month ago
This is correct answer. https://docs.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-3.1 If you apply multiple attributes then an accessing user must be a member of all the roles specified
upvoted 5 times
...
simonverma
4 years, 1 month ago
1 is not correct. 2 is correct. Either you write as [Authorize(Roles="SysAdmin, ProviderAdmin")] -- Roles- plural or [Authorize(Role="SysAdmin, ProviderAdmin")] [Authorize(Role="SysAdmin, ProviderAdmin")].
upvoted 1 times
...
...
lywwind
Highly Voted 5 years, 4 months ago
Box 1: [Authorize(Role= "ProviderAdmin")] [Authorize(Role = "SysAdmin")] Box 2: [Authorize(Policy = "ProviderEditor", Role = "SysAdmin")] Check this https://www.examtopics.com/exams/microsoft/az-202/view/4/
upvoted 34 times
lau13
4 years, 11 months ago
The suggested box 1 means that it will only authorize someone who is both ProviderAdmin and SysAdmin at the same time.
upvoted 7 times
...
...
sinh
Most Recent 4 years, 6 months ago
[Authorize(Role= "ProviderAdmin")][Authorize(Role = "SysAdmin")] are true if both are satisfied. [Authorize(Role = "SysAdmin, ProviderAdmin")] is true if either is met. [Authorize(Role = "SysAdmin, ProviderAdmin")] is the correct answer, as we only need one of these roles here.
upvoted 3 times
Cornholioz
4 years, 4 months ago
Isn't it the other way around? Requirement says Allow ProviderAdmin AND SysAdmin roles to Partner Controller. For AND, the box 1 should have it in two lines. So should the box 2? Unsure!
upvoted 2 times
...
RahulKate
4 years, 4 months ago
Options not mentioned with proper syntax, [Authorize(Roles = "Administrator, PowerUser")] so answer can be [Authorize(Role= "ProviderAdmin")][Authorize(Role = "SysAdmin")]
upvoted 1 times
...
...
Steve_az
4 years, 9 months ago
Answer option - https://vceguide.com/wp-content/uploads/2019/10/Microsoft-AZ-203-date-01-06-2019-00001_Page_058_Image_0002.jpg
upvoted 11 times
...
rafapaz09
4 years, 9 months ago
Correct answer should be Box 1. [Authorize(Role="SysAdmin, ProviderAdmin")] 2. [Authorize(Policy="ProviderPartner")] [Authorize(Role="SysAdmin")] Reference: https://docs.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-3.1 "If you apply multiple attributes then an accessing user must be a member of all the roles specified; the following sample requires that a user must be a member of both the PowerUser and ControlPanelUser role." By multiple attributes it means 2 different authorize attributes.
upvoted 6 times
...
Suchismita
4 years, 9 months ago
Correct answers are Box 1. (Allow the ProviderAdmin and SysAdmin roles access to the Partner controller) [Authorize(Role= "ProviderAdmin")] [Authorize(Role = "SysAdmin")] Box2. (users with an editor claim of partner who are also members of the SysAdmin role that means user should be both Provider Partner and SysAdmin) [Authorize(Policy="ProviderPartner")] [Authorize(Role="SysAdmin")] Refer https://docs.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-3.1
upvoted 5 times
Ave
4 years, 6 months ago
This is the correct answer
upvoted 1 times
...
...
Not_Sure_Who_Am_I
4 years, 10 months ago
Options: https://vceguide.com/wp-content/uploads/2019/10/Microsoft-AZ-203-date-01-06-2019-00001_Page_058_Image_0002.jpg
upvoted 11 times
...
AK89
4 years, 11 months ago
Box 1 : [Authorize(Role= "ProviderAdmin")] [Authorize(Role = "SysAdmin")] Box 2 : [Authorize(Policy = "ProviderEditor", Role = "SysAdmin")]
upvoted 9 times
...
chintan4190
5 years, 1 month ago
Options: https://www.certlibrary.com/exam/AZ-203
upvoted 15 times
...
Daltonic75
5 years, 2 months ago
https://docs.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-3.1 "If you apply multiple attributes then an accessing user must be a member of all the roles specified; the following sample requires that a user must be a member of both roles." The question said "Allow the ProviderAdmin and SysAdmin roles access". Both roles, so I think that is: [Authorize(Role= "ProviderAdmin")] [Authorize(Role = "SysAdmin")]
upvoted 4 times
hmirko
5 years, 1 month ago
I think it states that users with any of those roles are allowed, correct answers are 1. [Authorize(Role="SysAdmin, ProviderAdmin")] 2. [Authorize(Policy="ProviderPartner")] [Authorize(Role="SysAdmin")]
upvoted 20 times
oxaytol
4 years, 11 months ago
this is the correct answer. 1. Must either have sysadmin or provider admin, so [Authorize(Role="SysAdmin, ProviderAdmin")]. 2. Must have and editor claim of partner AND ALSO be a member of sysadmin, so in order to require BOTH: [Authorize(Policy="ProviderPartner")] [Authorize(Role="SysAdmin")]
upvoted 6 times
...
...
...
shanky_007
5 years, 5 months ago
Box1. [Authorize(Role = "SysAdmin, ProviderAdmin")] Box2. [Authorize(Policy = "ProviderEditor", Role = "SysAdmin")]
upvoted 15 times
gido
5 years, 3 months ago
Correct answer example found here: https://stackoverflow.com/questions/700166/allow-multiple-roles-to-access-controller-action
upvoted 4 times
...
LTiwana
4 years, 10 months ago
Seems correct. The difference between the below two statements is mention in MS docs and as per the question "Allow the ProviderAdmin and SysAdmin roles access" means users can be part of either group. ----------------------------- [Authorize(Role = "SysAdmin, ProviderAdmin")] ----------------------------- [Authorize(Role= "ProviderAdmin")] [Authorize(Role = "SysAdmin")] -----------------------------
upvoted 1 times
...
leshuva
4 years, 4 months ago
correct.bacause this Role = "SysAdmin, ProviderAdmin")] means either of these roles and this Authorize(Policy = "ProviderEditor", Role = "SysAdmin") means need to have both policy and the role
upvoted 1 times
...
...
Regimiento
5 years, 5 months ago
If someone wonders what should be in those boxes: Box 1: [Authorize(Policy = "ProviderEditor")] [Authorize(Role = "SysAdmin")] Box 2: [Authorize(Policy = "ProviderEditor", Role = "SysAdmin")]
upvoted 14 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago