Domain.com has a file server named Certkiller-SR07 that hosts company data.
You are currently in the process of creating an application that will be used by Domain.com users
to manage the data on Certkiller-SR07.
To ensure that Domain.com users have the appropriate file permissions on the working directory,
you define the DemanDirectorySecurity method as shown below.
public void DemanDirectorySecurity (string path) {
FileIOPermission filePerm = new FileIOPermission (PermissionState.None);
filePerm.AddPathList (FileIOPermissionAccess.AllAccess, path); filePerm.Assert ();
}
Subsequent to installing the new application, you find that some users do not have full access to their working directories.
You are informed that these Domain.com users only require read only access.
You are required to override the permission assertion in the DemanDirectorySecurity method for these users only.
What should you do?
A.
Use the following code:
FileIOPermission.RevertAssert();
FileIOPermission fileOVPerm = new FileIOPermission (PermissionState.None);
fileOVPerm.AddPathList (FileIOPermissionAccess.Read, path);
fileOVPerm.Assert ();
B.
Use the following code:
FileIOPermission fileOVPerm = new FileIOPermission (PermissionState.None);
fileOVPerm.AddPathList (FileIOPermissionAccess.Read, path);
fileOVPerm.Permit();
C.
Use the following code:
FileIOPermission.Revoke();
FileIOPermission fileOVPerm = new FileIOPermission (PermissionState.None);
fileOVPerm.AddPathList (FileIOPermissionAccess.Read, path);
fileOVPerm.Assert();
D.
Use the following code:
FileIOPermission fileOVPerm = new FileIOPermission (PermissionState.None);
fileOVPerm.AddPathList (FileIOPermissionAccess.Read, path);
fileOVPerm.OverrideAll();
Explanation:
This code invokes the Revert Assert method on the FileIOPermission class, instantiates a FileIOPermission object representing read-only access to the working directory, and invokes the assert method on the FileIOPermission object.
B, C, D: The Permit, OverrideAll, and Revoke methods do not exist in the FileIOPermission class.