(#56) Roles in MVC | Authorization in MVC | mvc tutorial for beginners in .net c# | MVC By Nitish

preview_player
Показать описание

Follow us on:👇
Рекомендации по теме
Комментарии
Автор

Even I don't understand your language but it was quit good for more by following logical steps .. Thank you . I hope to repeat this explanation in English

AlmutasimAlmazidi
Автор

Thank you for making MVC easy for entry-level professionals.

manishsenapati
Автор

This Video is incomplete once you see this. 19:45

kishorelunavath
Автор

For those who are not able to make it work, You all can implement this code.
Change the words in double quotes with your project file names.

public override string[] GetRolesForUser(string username)
{
var db = new "DatabaseEntityName"();
var user = => u."NameInTable"== username);
var userRoles = from ur in user."RoleTableName"
from r in db."RoleTableName"
where ur."Id in User Table"== r."Id in Role Table"
select r.Role;

if (userRoles != null)
return userRoles.ToArray();
else
return new string[] { }; ;
}

public override bool IsUserInRole(string username, string roleName)
{
var db = new "DatabaseEntityName"();
User user = => u."NameInTable"== username);

var roles = from ur in user."RoleTableName"
from r in db."RoleTableName"
where ur."Id in User Table"== r."Id in Role Table"
select r.Role;
if (user != null)
return roles.Any(r => r.Equals(roleName,
else
return false;
}

sagaraggarwal
Автор

ab yaha role based mai aapne khud se coding type krkey bataya hai to total achey se samaj mai aa gya hai ye topic bs aise hi chaiye

mohdnasirhussain
Автор

Best video 👍👍 JazakAllah
I was searching for it for many days

pcerrorsandsolutions
Автор

Agar user registration complete hone pe confirmation view pa jana ho tu phir confirmation action result ka attribute allow anonymous set krna ho ga k authorise.

derveshpasha
Автор

Sir this video is very useful one, it helps me lot. But I think this is incomplete, video is finished before you explain any operation with role.

sibeshghosh
Автор

Please help to remove this error Could not load type 'WebRoleProvider'.

SAADBILAL
Автор

Hi, Thanks for the tutorial. How can I use the Roles into Layout, to filter option in the menu?? Regards

AlejandroGuerrerowarrior
Автор

how do you make it so that when you have multiple softs in your soft roll; you arent interfereing with another soft like accidentally

hrushipedia
Автор

hi can u please explain open id connect and oauth2 basic terminology

NaveenKumar-mrxi
Автор

He saved his project using cntrl + s almost 1 million times

rohitmunde
Автор

tried exact same code do we need to make changes to the account controller?

rajeshjoisy
Автор

edmx update nahi hota im using mysql workbench is there any alternative besides deleting the whole edmx file and doing it again ? i am tired of creating new projects everytime i add a new table in db

flick--spadegaming
Автор

how we can assign roles dynamically ???

Uzair_Anwar
Автор

Very nice tutorial... Please create more videos...

bipinkunjilwar
Автор

how to redirect to access denied page after a role which doesnt have authrozition for action tries to call the action

NePhoosStAr
Автор

Video is awesome but after roles created the video ended can you please upload complete video.

balkishank
Автор

Sir can you please make videos on asp MVC small demo project.

rajeev
visit shbcf.ru