Created
November 9, 2019 04:03
-
-
Save winsonet/417479020d3d74edea3babb132753f66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Acl("Account", AllowActions: "Index,View")] | |
public class CirculationController : BaseController | |
{ | |
public CirculationController() | |
{ | |
} | |
public ActionResult Index() | |
{ | |
//do something... | |
} | |
public ActionResult AjaxHandler() | |
{ | |
//do something... | |
} | |
public ActionResult View() | |
{ | |
//do something... | |
} | |
public ActionResult Others() | |
{ | |
//do something... | |
} | |
} | |
public class AclAttribute : AuthorizeAttribute | |
{ | |
string _notAllowRoles; | |
string _allowActions; | |
/// <summary> | |
/// Set the ACL attribute for access right | |
/// </summary> | |
/// <param name="NotAllowRoles">Not allow roles, split with comma</param> | |
/// <param name="AllowActions">Set the actions allow for the restrict roles</param> | |
public AclAttribute(string NotAllowRoles, string AllowActions = null) | |
{ | |
_notAllowRoles = NotAllowRoles; | |
_allowActions = AllowActions; | |
} | |
public AclAttribute() : base() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment