Hide

YetaWF.Core Package Documentation

Display
Print

YetaWF.Core.Identity.ResourceAttribute Class

Used to define protected named resources. Protected resources can be used to restrict access to controllers based on user permissions.

The ResourceAttribute is typically used in a package's AssemblyInfo.cs file to define all named resources the package implements. These are collected during application startup by the AuthorizationResourceDataProvider.InitializeApplicationStartupAsync method.

The ResourceAuthorizeAttribute is used with controllers to protect by a named resource. Resource authorization is provided using Admin > Identity > Resources (standard YetaWF site). The AuthorizationDataProvider class is used to maintain authorization settings for roles and users.

Namespace: YetaWF.Core.Identity
Assembly: YetaWF.Core

Inheritance

Syntax

public class ResourceAttribute : System.Attribute;

Constructors

PublicResourceAttributeConstructor.

Properties

PublicAdministratorDefines whether a user with the administrator role has access to the protected resource.
PublicAnonymousDefines whether anonymous users have access to the protected resource.
PublicDescriptionA brief description of the protected resource. This description is shown when reviewing resources using Admin > Identity > Resources (standard YetaWF site).
PublicEditorDefines whether a user with the editor role has access to the protected resource.
PublicNameThe name of the protected resource.
PublicSuperuserDefines whether a user with the superuser role has access to the protected resource. This is mostly for documentation purposes as all resources are accessible by a superuser.
PublicInherited from System.AttributeTypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
PublicUserDefines whether logged on users have access to the protected resource.

Methods

PublicInherited from System.AttributeEqualsReturns a value that indicates whether this instance is equal to a specified object.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicStaticInherited from System.AttributeGetCustomAttributeRetrieves a custom attribute applied to a specified assembly. Parameters specify the assembly and the type of the custom attribute to search for.
PublicStaticInherited from System.AttributeGetCustomAttributesRetrieves an array of the custom attributes applied to an assembly. A parameter specifies the assembly.
PublicInherited from System.AttributeGetHashCodeReturns the hash code for this instance.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
PublicInherited from System.AttributeIsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
PublicStaticInherited from System.AttributeIsDefinedDetermines whether any custom attributes are applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for.
PublicInherited from System.AttributeMatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.

See Also YetaWF.Core Overview