Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

User roles in ASP.NET MVC 5

asp.net authentication user-roles

Best Answer BlackRabbit, 20 January 2015 - 02:58 AM

You'll have to modify it yourself.

Disable them on the page load event, based on a condition of registered/unregistered user.

Go to the full post


This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 jasonalien

jasonalien

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 194 posts

Posted 19 January 2015 - 01:49 AM

Hello all,

I'm trying to build a website using ASP.NET MVC 5. I create models using Entity Framework and Visual Studio generates controllers and views automatically. That does most of my job. But I need one more thing.

 

In default views, there is Create New/Update/Delete links visible to everyone. I want my program to show those links only to registered users. I want unregistered users to see items only, not change them. How can I achieve that?

 

Thanks.



#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 20 January 2015 - 02:58 AM   Best Answer

You'll have to modify it yourself.

Disable them on the page load event, based on a condition of registered/unregistered user.