开发者

Can I make all of the roles defined in an <asp:RoleGroup> required? (i.e. user must meet all roles)

开发者 https://www.devze.com 2023-02-13 00:37 出处:网络
Let\'s say I have a rolegroup as follows: <asp:LoginView ID=\"lvDoSomeStuff\" runat=\"server\"> <RoleGroups>

Let's say I have a rolegroup as follows:

<asp:LoginView ID="lvDoSomeStuff" runat="server">
    <RoleGroups>
        <asp:RoleGroup Roles="RoleOne,RoleTwo">
            <ContentTemplate>
            ...
            </ContentTemplate>
        </asp:RoleGroup>
    </RoleGroups>
</asp:LoginView>

Is ther开发者_如何学Ce a way I can make it so that a user must meet RoleOne and RoleTwo to satisfy the RoleGroup? By default, if a user is in either of the two roles, they will be granted access.

I know I can do this via the code-behind, but I'd prefer to be able to wrap some content template with this markup instead of having to wrap it in a panel and hide the panel programmatically.

Thanks!


There is no way of telling the RoleGroup section to require all roles. You must implement that type of logic in the code-behind.

0

精彩评论

暂无评论...
验证码 换一张
取 消