views:

60

answers:

1

Hello everyone,

I am confused about this property, as mentioned here, http://msdn.microsoft.com/en-us/library/system.security.permissions.securityattribute.unrestricted.aspx we could give it full or non-full.

My confusion is for permission in a straightforward understanding, there should be only two status -- granted and not-granted, what does th full and non-full mean?

thanks in advance, George

+1  A: 

I have previously used the Unrestricted attribute in the classic way:

The following code is a request stating that an assembly must have unrestricted access to the file system in order to function.

using System.Security.Permissions;
// Indicates that FileIOPermission is required to run this assembly.
[assembly:FileIOPermission(SecurityAction.RequestMinimum, Unrestricted=true)]
public class FileManager
{
// Insert code to add and delete files.
}

in this context Unrestricted=false would mean file access is not nessessarily required, for the method to execute.

as opposed to the 'oppisite' which would require that in order for the method to execute, file access must not be granted.

In most cases where the SecurityAction (Unrestricted=true||false) may be created dynamicaly, the first case usually makes more sense.

Jim
Thanks Jim, 1. could I understand in this way -- when unrestricted is true, it means the permission is granted, and when unrestricted is false, it means the permission is not granted. Is that correct understanding? 2. Previously, my confusion is the word "unrestricted" makes me think that when unrestricted is false, it means limited/partial permission (the opposite of full is partial/limited). But from your reply, I think the "opposite" of unrestricted is none permission. Any comments?
George2