For authorization
we allow some roles and deny some roles, let’s say we are allowing only those
users who are in admin group as follows;
Once authorization tag is added in Web.config file, we need to create authorization controller which will be having method to get if authorization true/false for the users. So create following method in authController.cs;
Last step is reading the value from controller, usually we get the requirement for enable/disable screen button as per the role/authorization. So for above example we will create simple button on the HTML screen which will redirect to OrderDetails on click and button will be enable only if the user is in AdminGroup role.
No comments:
Post a Comment