SiteMapNode.Roles 属性
定义
获取或设置与 SiteMapNode 对象关联的角色集合,这些角色用于安全修整期间。Gets or sets a collection of roles that are associated with the SiteMapNode object, used during security trimming.
public:
property System::Collections::IList ^ Roles { System::Collections::IList ^ get(); void set(System::Collections::IList ^ value); };
public System.Collections.IList Roles { get; set; }
member this.Roles : System.Collections.IList with get, set
Public Property Roles As IList
属性值
例外
该节点是只读的。The node is read-only.
注解
如果启用了安全修整,则站点地图提供程序将根据当前用户的已分配角色是否包含在集合中,生成当前用户能够查看的节点的节点树 Roles 。If security trimming is enabled, a site map provider builds a node tree of nodes that the current user is able to view, based in part on whether the current user's assigned role is included in the Roles collection. URL 授权和文件授权还用于确定用户是否具有访问对象的权限 SiteMapNode 。URL authorization and file authorization are also used to determine whether a user has the rights to access a SiteMapNode object. 有关授权的详细信息,请参阅 ASP.NET authorization。For more information on authorization, see ASP.NET Authorization.
SiteMapNode SiteMapNode 首次创建对象时,可以使用构造函数向其提供角色列表。You can use the SiteMapNode constructor to supply a list of roles to the SiteMapNode object when it is first created.