Giter Site home page Giter Site logo

dotnetcurry / asp.net-action-methods-multiple-roles Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 4.0 1.31 MB

Accessing same Action Method by Multiple Roles and Users in ASP.NET MVC using Configuration File

Home Page: http://www.dotnetcurry.com/aspnet-mvc/1268/access-action-method-multiple-user-roles-using-config

C# 84.84% CSS 0.47% ASP 0.10% HTML 4.72% JavaScript 9.87%

asp.net-action-methods-multiple-roles's People

Contributors

dotnetcurry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

asp.net-action-methods-multiple-roles's Issues

Same roles different companies

Great work.

I have a question on how to administer a small Saas app, for e.g. I have 2 stores A, B and 1 gas station G, each with - Admin, Managers and Employees - and these roles names are common across (I am super Admin)

I don't want to create new role names and managers for each store, can you suggest how would I ensure they only the manager from the store A see employees of Store A, a multi tenant-pockets of users for there work and money.

How can this be achieved please.

thanks
giri

How to force the user to login?

Hi, i had one other issue, I was able to get the DB connection working... ๐Ÿ’ฏ

What happens when the admin changes a role for a user, does it invalidate the roles collection object? and force you to re-login?

Or do I need to restart the entire app?

Is there a Cache-invalidation object?

thanks

Registration error in view data, looks like the selectedItem value is not used

Server Error in '/' Application.

The ViewData item that has the key 'Name' is of type 'System.String' but must be of type 'IEnumerable<SelectListItem>'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: The ViewData item that has the key 'Name' is of type 'System.String' but must be of type 'IEnumerable<SelectListItem>'.

Source Error: 


Line 34:         @Html.Label("Select Your User Type", new { @class = "col-md-2 control-label" })
Line 35:         <div class="col-md-10">
Line 36:             @Html.DropDownList("Name")  
Line 37:         </div>
Line 38:     </div>

Source File: d:\users\gir\asp.net-action-methods\CustomRoles\Views\Account\Register.cshtml    Line: 36 

Stack Trace: 


[InvalidOperationException: The ViewData item that has the key 'Name' is of type 'System.String' but must be of type 'IEnumerable<SelectListItem>'.]
   System.Web.Mvc.Html.SelectExtensions.GetSelectData(HtmlHelper htmlHelper, String name) +355

image

Can you show me how to map Roles to the Actions

Hello, first thanks for posting, ๐Ÿ‘ i previously also commented and i follow your blog. I tried to comment on the others, but see that this is your latest post.

Can you tell me how to apply new roles to the actions/controller without modifying the code, i.e. from a GUI/webpage MapRoleToActionsView.cshtml and in the manage controller MapRoleToAction(Role role, String ControllerAction)

I am looking to make it easy for the user to manage roles, and map them to an action in the view/GUI.

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.