UserManagement.Security
1.1.2
dotnet add package UserManagement.Security --version 1.1.2
NuGet\Install-Package UserManagement.Security -Version 1.1.2
<PackageReference Include="UserManagement.Security" Version="1.1.2" />
paket add UserManagement.Security --version 1.1.2
#r "nuget: UserManagement.Security, 1.1.2"
// Install UserManagement.Security as a Cake Addin #addin nuget:?package=UserManagement.Security&version=1.1.2 // Install UserManagement.Security as a Cake Tool #tool nuget:?package=UserManagement.Security&version=1.1.2
UserManagement
It allows to manage user access through roles and permissions in an Intranet applications. It uses easily and is easily reusable.
It is necessary to download the following Packages
- UserManagement.Core
- UserManagement.SqlServer
- UserManagement.Security
Currently it is only possible to use a DB SQL SERVER.
Installation
To use 'application user management is necessary to enter this section of code in the Owin Start Class.
GlobalConfiguration.Configuration
.UseSqlServerStorage("<SQL Connection>"
,new SqlServerStorageOptions());
The ** SqlServerStorageOptions ** Class has the following properties:
- PrepareSchemaIfNecessary
- Indicate if you need to create the schema (default true)
- TransactionTimeout
- Time Out for SQL transactions
- CommandTimeout
- Time Out for SQL commands
- SchemaName
- Indicates the name of the Schema which create tables (default UserManagement UserManagement)
To view the Dashboard will also need to add one more row in the Start Owin file
app.UseUserManagerDashboard("Name App");
This call is also possible to add options through the class DashboardOptions
- AppPath (Path of the reference Intranet application)
- Authorization (Management of internal permissions to UserManagement)
- DisplayStorageConnectionString (Viewing the connection string)
- DashboardTitle (DashBoard title)
Usage Example
GlobalConfiguration.Configuration.UseSqlServerStorage("Server=name_server; Database=DBGeneric; user id=User234;password=User234", new SqlServerStorageOptions { CommandTimeout = TimeSpan.FromMinutes(5) }); app.UseUserManagerDashboard("/Admin");
Writing the above, it will be possible to view the DashBoard by typing the word Admin in the URL (ex: http://myproject.com/Admin)
Authorization Management
In the Security package we find two classes.
- UserManagementAuthorize
- Attribute used to manage authorizations
- UserManagementFormAuthentication
- Contains two functions SigIn and SigOut (for access management with Web form)
UserManagementAuthorize
It can be used on methods, property classes and manages access to the resource. Allows you to define Rules, Permissions and Users divided by ";"
Example
[UserManagementAuthorize(Roles ="R1;R2")] public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); }
UserManagementFormAuthentication
If you use Form authentication we have two static methods available:
- SigIn(string userName, string password)
- SigOut()
These allow the user to login and logout.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Dapper (>= 2.0.35)
- UserManagement.Core (>= 1.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.