I am going to take Microsoft 70-486 (MVC) exam. So i am preparing for it. Came across one most important question asking in 70-486 exam but does not satisfied with the answer they given.
The Question
You are developing an ASP.NET MVC application that uses forms authentication.
The user database contains a user named LibraryAdmin
.
You have the following requirements:
- You must allow all users to access the
GetBook
method. - You must restrict access to the
EditBook
method to the user namedLibraryAdmin
.
You need to implement the controller to meet the requirements.
Which code segment should you use? (Each correct answer presents a complete solution. Choose all that apply.)
But According to question i must restrict restrict access to the EditBook method to the user named LibraryAdmin
Both Option A and C will allow acces to Edit Book. So i feel the answer is wrong. Then what is correct answer?
ref: From DOCUMENT