Answer the question
In order to leave comments, you need to log in
How to restrict rights in DAL?
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
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.
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question