N
N
nordwind20132018-07-10 10:44:18
ASP.NET
nordwind2013, 2018-07-10 10:44:18

How to restrict rights in DAL?

7hhutFKq9vo.jpg
This is how it looks now. And how to implement access restrictions (for example, which user can watch the video and which cannot)? Everything needs to be done in the DAL layer.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny, 2018-07-10
Maltsev @maltsever

Hey! The question is a little unclear. In the controller, you can get the user role (for example, the VideoViewer role), and then pass it where it should be. Depending on this, decide whether to show or not.

M
Michael, 2018-07-10
@MickMS

Look towards Identity.
If you need without frameworks, then I suggest getting a type that would check which user enters under which role. And produce the desired result depending on the role. This is the easiest option.
As a rule, DAL describes not the application logic, but the concept of data storage, roughly speaking.
Application logic is taken out in BLL. In your case, the restriction of data access rights is rather the logic of the proposal itself.
If I understand the question correctly.

S
Sergey Lerg, 2014-11-11
@Lerg

And so?
'INSERT INTO `book` VALUES(1, "Fahrenheit 451");'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question