Ejemplo n.º 1
0
 public SecurityInfoPermission(AttributeWrapper attribute)
 {
     _attributeData = attribute.AttributeData;
     _attribute     = attribute.Attribute;
     if (_attributeData != null)
     {
         HasAttribute    = true;
         PermissionLevel = (SecurityPermissionLevels)_attributeData.GetPropertyValue("PermissionLevel", SecurityPermissionLevels.AllowAuthorized);
         Roles           = PermissionLevel != SecurityPermissionLevels.DenyAll ? (string)_attributeData.GetPropertyValue("Roles", string.Empty) : string.Empty;
         Name            = _attributeData.AttributeClass.Name.Replace("Attribute", string.Empty);
     }
     else if (_attribute != null)
     {
         HasAttribute    = true;
         PermissionLevel = _attribute.PermissionLevel;
         Roles           = PermissionLevel != SecurityPermissionLevels.DenyAll ? _attribute.Roles : string.Empty;
         Name            = _attribute.GetType().Name.Replace("Attribute", string.Empty);
     }
 }