070-559 Free Dumps Study Materials
Question 6: You have just graduated from college,now you are serving the internship as the software
developer in an international company. According to the requirements of the company CIO, you're
developing a server. You are developing an application. Users who are not members of the
Administrator group are not allowed to run the application. You protect sensitive data within the
application by writing the security code below:
Dim blnAdmin As Boolean = False
Dim objRole As WindowsBuiltInRole = _
WindowsBuiltInRole.Administrator
If blnAdmin = False Then
Throw New Exception("User not permitted")
End If
Now if a user is not a member of the Administrator group, the application must throw an exception.
You must add a code segment to this security code to ensure this.
In the options below, which code segment should you use?
objGroup.Value.Equals(objRole)Next
A. Dim objUser As GenericPrincipal = _DirectCast(Thread.CurrentPrincipal, GenericPrincipal)blnAdmin
= objUser.IsInRole(objRole.ToString)
B. Dim objUSer As WindowsIdentity = _DirectCast(Thread.CurrentPrincipal.Identity,
WindowsIdentity)blnAdmin = objUSer.Name.EndsWith("Administrator")
C. Dim objUser As WindowsPrincipal = _DirectCast(Thread.CurrentPrincipal,
WindowsPrincipal)blnAdmin = objUser.IsInRole(objRole)
D. Dim objUser As WindowsIdentity = WindowsIdentity.GetCurrentFor Each objGroup As
IdentityReference In objUser.GroupsDim objAccount As NTAccount = _
DirectCast(objGroup.Translate( _ Type.GetType("NTAccount")), NTAccount)blnAdmin =
Correct Answer: C