Reference:SecurityController

From Bistro
Jump to: navigation, search

Contents

Overview

The SecurityController class is a default, deny-first implementation of the ISecurityController interface.

Usage

This class is used as a marker defining which bind points require what permissions for access. When bound to a specific bind point, all controllers matching that bind point will be subject to the requirements defined in the security controller.

Example

Given the following security definition

[Bind("/action/search")]
[Deny("?", OnFailure = FailAction.Redirect, Target = "/action/signin")]
public class SearchSecurity : SecurityController { }

these controllers would not be accessible by anonymous users

[Bind("/action/search/{contentType}/first-time")]
public class FirstTimeSearch : AbstractController
{
...
}
 
/// <summary>
/// Summary description for Search
/// </summary>
[Bind("/action/search/{contentType}")]
public class Search : AbstractController
{
...
}

Furthermore, attempts to access any of these two controllers while not being authenticated, would result in a FailAction of Redirect, and would redirect the user to the Target, or /action/signin

See also

SecurityController in the Bistro Class Library.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox