Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Data Filter Suggestion #1077


User avatar
0
maharatha created

Hi Hilkan -

I am implementing some kind of access restriction into my application.

Let's say I have multiple entities Entity A, B,C which I want to provide restrictive access to certain users.

For that I am planning to use data filters, IMayHaveUserRestriction.

I created the interface as well , but I can't implement this in my Entity A else it would create a column UserId in Entity A ,B,C which I definitely don't want.

My restriction rules or data are placed in a another Entity called Entity R.

The whole idea is to create a data filter which I can use it in any entity and it would filter based on some rules.

Could you guide me how to do this using Abp ?

Thanks, Partha


3 Answer(s)
  • User Avatar
    0
    maharatha created

    When I say access to Entities that would mean certain rows in the Entities. The details of the entities and rows are being stored in Entity R

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    As you probably know, we are using EntityFramework.DynamicFilters (<a class="postlink" href="https://github.com/jcachat/EntityFramework.DynamicFilters">https://github.com/jcachat/EntityFramew ... micFilters</a>). EntityFramework has not such a built-in feature and EntityFramework.DynamicFilters fills the gap well. But it also has some possibilities. I suppose it does not support such a filter that requires join with another table. You can see it's own document to understand it better.

    Why don't you use organization units? See the sample code: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units#filter-entities-for-a-user">http://www.aspnetboilerplate.com/Pages/ ... for-a-user</a> I think it's similar to your needs.

  • User Avatar
    0
    maharatha created

    I am using Organization as My Company. Also I want to implement something like RLS (Row Level Security) for each entity. So using Organization is not an option. I am looking into EFF Dynamic Filter and Predicate builder to achieve this. Will update this ticket with my findings. In case you have some idea please let me know.