System to abstract the job ob create permissions based on claims
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitattributes
.gitignore
.travis.yml
AspNetCore.Identity.ByPermissions.sln
LICENSE
README.md

README.md

AspNetCore.Identity.ByPermissions

Description

This system provides a abstraction layer of the claims system, registering the claims as attributes.The Identity framework manages the access checks and the system store the different permissions in a collection in order to access them in a manager page. This does easier the work of manage the access becouse once the manage zone is written, it's only necesary add attributes.

In Work:

In the RazorPage branch I'm doing the views code to do full usage package. The branch will be merged when it's done. Between that, it's posible to use following the example proyect.

Information in build

Soon I am going to write the documentation, sorry (The next info is not complete)...

  1. Register the "Permissions Service"
public void ConfigureServices(IServiceCollection services)
{
  ....
  services.AddAuthorization(options =>
  {
      options.AddPermissions(new PermissionService());
  });
  ....
}
  1. Add the Permissions in the "Controllers" and "Actions"
//[AttributePermission("Permission Name","Description")]
[Permission("Home",  "Can access to Home Controller")]
public class HomeController : Controller
{
  public IActionResult Index()
  {
    return View();
  }
  //This line add a Permissions named "About" with a description and assigned to the action
  [Permission("About",  "Can see about page")]
  public IActionResult About()
  {
    ViewData["Message"] = "Your application description page.";
    return View();
  }
}

Compilation

Branch AppVeyor Travis
master Build status Build Status
RazorPage Build status Build Status

Get it from NuGet

NuGet NuGet