Role-based access control (RBAC) vs. Claims-based access control (CBAC) in ASP.NET MVC

What are the main benefits of using CBAC vs. RBAC? When is it better to use CBAC and when is it better to use RBAC? I’m trying to understand the general concepts of the CBAC model but the general idea is still not clear for me. 12 Answers 12

ASP.NET MVC Html.ValidationSummary(true) does not display model errors

I have some problem with Html.ValidationSummary. I don’t want to display property errors in ValidationSummary. And when I set Html.ValidationSummary(true) it does not display error messages from ModelState. When there is some Exception in controller action on string MembersManager.RegisterMember(member); catch section adds an error to the ModelState: ModelState.AddModelError(“error”, ex.Message); But ValidationSummary does not display this … Read more

Visual Studio – Resx File default ‘internal’ to ‘public’

Every time I edit a resource file in VS, it regenerates the corresponding code and sets the class access modifier to internal. It’s a pain to Ctrl-F -> ReplaceAll every time I edit the resx. Is there a property/setting so that I can default this to public? internal class MyResource { internal static global::System.Resources.ResourceManager ResourceManager … Read more

ASP.NET Bundles how to disable minification

I have debug=”true” in both my web.config(s), and I just don’t want my bundles minified, but nothing I do seems to disable it. I’ve tried enableoptimisations=false, here is my code: //Javascript bundles.Add(new ScriptBundle(“~/bundles/MainJS”) .Include(“~/Scripts/regular/lib/mvc/jquery.validate.unobtrusive.js*”) .Include(“~/Scripts/regular/lib/mvc/jquery.validate*”) .Include(“~/Scripts/regular/lib/bootstrap.js”) .IncludeDirectory(“~/Scripts/regular/modules”, “*.js”, true) .IncludeDirectory(“~/Scripts/regular/pages”, “*.js”, true) .IncludeDirectory(“~/Scripts/regular/misc”, “*.js”, true)); //CSS bundles.Add(new StyleBundle(“~/bundles/MainCSS”) .Include(“~/Content/css/regular/lib/bootstrap.css*”) .IncludeDirectory(“~/Content/css/regular/modules”, “*.css”, true) .IncludeDirectory(“~/Content/css/regular/pages”, “*.css”, true)) … Read more

What is ASP.NET Identity’s IUserSecurityStampStore interface?

Looking at ASP.NET Identity (new membership implementation in ASP.NET), I came across this interface when implementing my own UserStore: //Microsoft.AspNet.Identity.Core.dll namespace Microsoft.AspNet.Identity { public interface IUserSecurityStampStore<TUser> : { // Methods Task<string> GetSecurityStampAsync(TUser user); Task SetSecurityStampAsync(TUser user, string stamp); } } IUserSecurityStampStore is implemented by the default EntityFramework.UserStore<TUser> which essentially get and set the TUser.SecurityStamp property. … Read more

renderpartial with null model gets passed the wrong type

I have a page: <%@ Page Inherits=”System.Web.Mvc.View<DTOSearchResults>” %> And on it, the following: <% Html.RenderPartial(“TaskList”, Model.Tasks); %> Here is the DTO object: public class DTOSearchResults { public string SearchTerm { get; set; } public IEnumerable<Task> Tasks { get; set; } and here is the partial: <%@ Control Language=”C#” Inherits=”System.Web.Mvc.ViewUserControl<IEnumerable<Task>>” %> When Model.Tasks is not null, … Read more