GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 112 Topic 12 Discussion

GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 112 Topic 12 Discussion

GSSP-.NET Exam Topic 12 Question 112 Discussion:
Question #: 112
Topic #: 12

You work as a Software Developer for ABC Inc. You use C# .NET to develop a windows application. The application will implement a role-based authorization scheme that is based on a Microsoft SQL Server database of user names. Users will enter their names in a text box named UserName. You must ensure that users are assigned the supervisor role and the PG role by default. Which of the following code segments will you use to accomplish this task?


A.

GenericIdentity identity =

new GenericIdentity(UserName.Text);

string[] RoleArray = {"Supervisor", "PG"};

WindowsPrincipal principal = new WindowsPrincipal(identity);


B.

WindowsIdentity identity =

new WindowsIdentity.GetAnonymous();

string[] RoleArray = {"Supervisor", "PG"};

WindowsPrincipal principal = new GenericPrincipal(identity, RoleArray);


C.

GenericIdentity identity =

new GenericIdentity(UserName.Text);

string[] RoleArray = {"Supervisor", "PG"};

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);


D.

WindowsIdentity identity =

new WindowsIdentity.GetCurrent();

string[] RoleArray ={"Supervisor", "PG"};

GenericPrincipal principal = new GenericPrincipal(identity, RoleArray);


Get Premium GSSP-.NET Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.