Exam Questions that use .Demand or .LinkDemand COULD NOT BE ANY MORE CONFUSING OR AMBIGIOUS ????
- by IbrarMumtaz
I am 110% sure this is WRONG !!!!
Q.12) You develop a library, and want to ensure that the functions in the library cannot be either directly or indirectly invoked by applications that are not running on the local intranet. What attribute would you add to each method?
A. [UrlIdentityPermission(SecurityAction.RequestRefuse, Url="http://myintranet")]
B. [UrlIdentityPermission(SecurityAction.LinkDemand, Url="http://myintranet")] (correct answer)
C. [UrlIdentityPermission(SecurityAction.Demand, Url="http://myintranet")]
D. [UrlIdentityPermission(SecurityAction.Assert, Url="http://myintranet")]
Explanation
Link-Demand should be used as it ensures that all callers in the call stack have the necessary permission. In this case it ensures that all callers in the call stack are on the local intranet.
There is an indentical question on Transencer so I already had a clue what was goin but Transcender was much more informative that this drivel as it mentioned class level and not assembly level. It also mentioned that some callers maybe coming externally from the company intranet via authroised and authenticated credentials. With information is easy to see why .Demand on would be wong option to go for? So Transcender was right .... so I thgt fine, that makes sense. With think information still fresh in my brain I had a good idea was was going on in the question. To my surprise .Demand was wrong agin !!!!
WHAT?
I am really starting to hate this setting now? I cannot be any more p*ssed right now!!! :@
Thanks For Reading,
Ibrar