In your attribute class PermissionAttribute there is not much more to do than to store the users name. An attibute is just a method of decorating classes or methods with additional information it does not do any actual work. It can't really do any actual work as the attribute does not know anything of the class or method it decorates. If you want some introductory material regarding attributes please refer to the following links:
Introduction to Attributes[
^]
-
Using Attributes[
^]
-
Attribute Targets[
^]
-
Global Attributes[
^]
-
Creating Custom Attributes[
^]
-
Retrieving Information[
^]
The last item is of special interest to you. In your code you need to find out if a certain class or method is decorated with the attribute(s) you generated. Your code then decides what to do when such an attribute is found and takes the appropriate actions. Data contracts and operation contracts are examples of using attributes in the .NET Framework.
Regards,
Manfred