Visual Guard Class Library Documentation

VGIPermissionAttribute.Value Property

Gets or sets the value of the attribute.

Object Value {get; set;}

Example

This example modify the argument Country of the permission '\Common\Display only information on a country'

[Visual Basic]
Dim PermId As Guid = New Guid("975d80d8-b23f-4226-8cc8-ce2965e59e8c") ' Id of the permission "\Common\Display only information on a country"
' Checks if the permission is granted to the current user and gets the argument value assign to this permission
If Not VGSecurityManager.Principal.HasPermission(PermId) Then
    MessageBox.Show("The permssion '\Common\Display only information on a country' is not granted to the current user")
Else
    Dim myPerm As VGIPermission = VGSecurityManager.Principal.GetPermission(PermId)
    Dim attr As VGIPermissionAttribute = myPerm.Attributes.GetAttributeByName("Country")
    attr.Value = "France"
    MessageBox.Show("The current user can now see information about the country 'France'")
End If
[C#]
Guid PermId = new Guid("975d80d8-b23f-4226-8cc8-ce2965e59e8c");
// Id of the permission "\Common\Display only information on a country"
// Checks if the permission is granted to the current user and gets the argument value assign to this permission
if (!VGSecurityManager.Principal.HasPermission(PermId))
{
    MessageBox.Show("The permssion '\\Common\\Display only information on a country' is not granted to the current user");
}
else
{
    VGIPermission myPerm = VGSecurityManager.Principal.GetPermission(PermId);
    VGIPermissionAttribute attr = myPerm.Attributes.GetAttributeByName("Country");
    attr.Value = "France";
    MessageBox.Show("The current user can now see information about the country 'France'");
}

See Also

VGIPermissionAttribute Interface | Novalys.VisualGuard.Security Namespace