All Projects → eyedia → aarbac

eyedia / aarbac

Licence: Apache-2.0 license
An Automated Role Based Access Control .NET framework with T-SQL Query Parser which automatically parse select, insert, update, delete queries based on the logged in user role

Programming Languages

C#
18002 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
pascal
1382 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to aarbac

dapper-repositories
CRUD for Dapper
Stars: ✭ 523 (+2805.56%)
Mutual labels:  crud, nuget
SimplePHP
A small query builder project designed to assist daily routines and speed up the process of communicating with the database.
Stars: ✭ 14 (-22.22%)
Mutual labels:  query, crud
Microorm.dapper.repositories
CRUD for Dapper
Stars: ✭ 424 (+2255.56%)
Mutual labels:  crud, nuget
Aura.ui
A Library with a lot of Controls for AvaloniaUI
Stars: ✭ 114 (+533.33%)
Mutual labels:  control, nuget
Xamarin.Forms.MultiSelectListView
☑️ Select multiple rows in a listview with xamarin.forms
Stars: ✭ 61 (+238.89%)
Mutual labels:  control, nuget
Xamarin.forms.breadcrumb
This is a breadcrumb navigation control that is complete automatic and uses the Navigation stack and page titles to generate the breadcrumbs.
Stars: ✭ 130 (+622.22%)
Mutual labels:  control, nuget
express-mquery
Expose mongoose query API through HTTP request.
Stars: ✭ 37 (+105.56%)
Mutual labels:  query, filters
Reactive.XAF
DevExpress XAF extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
Stars: ✭ 60 (+233.33%)
Mutual labels:  wiki, nuget
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+6944.44%)
Mutual labels:  query, select
Ducky
Duck-Typed Value Handling for JavaScript
Stars: ✭ 71 (+294.44%)
Mutual labels:  query, select
Toastnotifications
Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.
Stars: ✭ 507 (+2716.67%)
Mutual labels:  control, nuget
CSJsonDB
A C# package that performs basic CRUD ( Create, Read, Update, Delete ) operations on a Json file, used for sample minimalistic DBs.
Stars: ✭ 75 (+316.67%)
Mutual labels:  crud, nuget
ColorPicker
Customizable Color Picker control for WPF
Stars: ✭ 57 (+216.67%)
Mutual labels:  control, nuget
Grbac
👮 grbac is a fast, elegant and concise RBAC(role-based access control) framework
Stars: ✭ 231 (+1183.33%)
Mutual labels:  control, access
King.Azure.Imaging
Image API & processing for Azure Web Apps
Stars: ✭ 20 (+11.11%)
Mutual labels:  wiki, nuget
node-reactive-postgres
Reactive queries for PostgreSQL
Stars: ✭ 28 (+55.56%)
Mutual labels:  query, select
Rbac
Hierarchical Role-Based Access Control for Node.js
Stars: ✭ 254 (+1311.11%)
Mutual labels:  authorization, role
Stuntman
Library for impersonating users during development leveraging ASP.NET Identity.
Stars: ✭ 285 (+1483.33%)
Mutual labels:  nuget, authorization
Semanticmediawiki
🔗 Semantic MediaWiki turns MediaWiki into a knowledge management platform with query and export capabilities
Stars: ✭ 359 (+1894.44%)
Mutual labels:  query, wiki
Gatekeeper
Lightweight library in C# for implementing roles-based access control (RBAC). With Gatekeeper, you can define users, roles, resources, and permissions, and authorize requests.
Stars: ✭ 25 (+38.89%)
Mutual labels:  nuget, authorization

Aarbac logo

Background & Thoughts

Technology solution is vast these days, and there is always at least one solution for every technical problem. A typical application has following layers:

  1. Security Layer (Authentication & Authorization)
  2. User Interface Layer
  3. Business Logic Layer
  4. Data Access Layer
  5. And a RDBMS database

Without aarbac

Security layer generally just performs authentication & authorization, and to facilitate roles (permissions & entitlements), developers implement various HasPermission(), IsInGroup(), etc. type methods with many ifs elses & switches, various sql queries and inject code into these layers(2, 3 & 4). Basically to enure that users with appropriate rights are performing appropriate operations. Users should see what they should see on the screens, users able to do what they are allowed to do with data.

During initial few releases, everything looks good, but messed up soon when complex business scenarios, exceptions are introduced, more ifs, switches are introduced in those layers, code quality decreases and code volume increases and makes production support & enhancements difficult. Nightmare for new team members!

What is aarbac?

aarbac is An Automated Role Based Access Control .NET framework which can override all CRUD(Create, Read Update, Delete) operations automatically based on the logged in user role. It separates out permission related code into a complete new layer and let these layers (2, 3 & 4) do their regular job & not worried about the permission at all. Additionally it also maintains user entitlements. aarbac

  1. Automated - Data Filter & Permissions are abstracted into a separate layer and all automated.
  2. Schema based - Data filters and permissions are based on your database schema.
  3. Clean Code - Clean code, less error, less testing, less maintenance.
  4. Encrypted - The role, entitlements & user parameters are encrypted and stored as binary in the aarbac database.
  5. Disable overriding for specific queries - As we do understand there will be few queries where aarbac may not able to produce automated result as desired, in those cases, just switch off aarbac.
  6. Comes with REST API, Utility, WinApp testbed, Sample Code.
  7. Pluggable.
  8. nuget deployed

1. Automated Data Filters & Permissions (Schema Based)

Apply row & column level permissions on your SELECT,INSERT,UPDATE & DELETE queries. For example, a read (or select) operation like the following …

select * from Author

automatically may get converted to...

SELECT Author.AuthorId, Author.Name, Author.ZipCodeId FROM Author 
inner join [ZipCode] [t9] on [t9].ZipCodeId = [Author].ZipCodeId 
inner join [City] [t10] on [t10].CityId = [t9].CityId WHERE t10.Name in ('New York','Charlotte')

...assuming user belongs to a role which allows him to see only 3 columns from author table and only allowed to see authors from New York and Charlotte cities.

And an update query like the following...

update Author set Name = 'Eyedia', SSN = '999-99-9999' where AuthorId = 9999

may hit exception like...

- User ‘abc’ does have permission to update table ‘Author’ but does not have permission to update column ‘SSN’

Sample Code

Select:

using (Rbac rbac = new Rbac("essie"))   //<-- you should pass the logged in user name from the context
{
    using (RbacSqlQueryEngine engine = new RbacSqlQueryEngine(rbac, query))
    {
        engine.Execute(); //<-- automatically parse and transform query based on role
        if ((!engine.IsErrored) && (engine.Parser.IsParsed) 
            && (engine.Parser.QueryType == RbacQueryTypes.Select))
            return engine.Table; //<-- if it is select query, the table will be loaded
    }
}

Inserts, updates and deletes

using (Rbac rbac = new Rbac("essie"))   //<-- you should pass the logged in user name from the context
{
    using (SqlQueryParser parser = new SqlQueryParser(rbac))
    {
        parser.Parse(query); //<-- this will throw exception if not permitted                   
        //<-- if you are here, you are goood. Just perform basic insert/update/delete
    }
}

2. Entitlements (Menu/Sub-Menu & Screen/Screen-Elements)

Every rule in aarbac has screen entitlement, you can define entitlements for your applications in following 2 categories:

1. Menus - Menu and sub menues within (linked list nodes)

2. Screens - Screen and Screen Elements (linked list nodes)

And just set visible and enabled properties on those nodes.

When user logs in, i.e. authenticated and authorized based on your authentication mechanism(for example active directory of the organization), just map user with a specific aarbac role, & each role will have entitlement. App developers need to apply the entitlement xml into the menu and screen elements.


Prerequisites:

  1. Microsoft SQL Server.
  2. .NET 4.5.2+
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].