M
M
Matsun2017-05-28 17:47:32
ASP.NET
Matsun, 2017-05-28 17:47:32

ASP NET Identity - how to display messages about insufficient rights?

There is an admin panel, in the admin panel there are 2 roles - admins and editors. Editors can only post news, but cannot get into editing site settings.
At the moment, if the editor climbs into the settings, it will redirect to the authorization page, which is not logical, as it seems to me.
How to understand that the user does not have enough rights (that is, the wrong role) to access a certain action? How to redirect it not to the authorization page, but to the main page of the admin panel, and display a message - not enough rights?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Filatov, 2017-05-28
@NYMEZIDE

Backend give 403 forbidden. Frontend catch and take out - they say it's forbidden. Without any redirects.
This is normal practice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question