Solved

Field security -- ASP.Net MVC 4 C#

Posted on 2013-06-20
3
521 Views
Last Modified: 2013-07-03
I am using ASP.Net MVC 4 C# Simple Membership.

What easy add-on/etc can I get make the
below View/Index.cshtml coding easier ?

Summary
 1. Index.cshtml page has 100+ textboxes
 2. each textbox has one of the below options
    depending on record's WorkFlowStage
    and logged in user's role
       ** Hidden
       ** ReadOnly --> below DisplayFor
       ** ReadWrite --> below EditorFor
------------------------------------------------
            @if(item.WorkFlowStage == '2')
            {
                if (User.IsInRole("BUICK_Inspector"))
                {    
                    <td>@Html.EditorFor(modelItem => item.CreatedBy)</td>
                    //also put 100+ other textboxes that are on this form
                }

                if (User.IsInRole("BUICK_LeadMan"))
                {    
                    <td>@Html.DisplayFor(modelItem => item.ProjectID)</td>
                    <td>@Html.DisplayFor(modelItem => item.CreatedBy)</td>
                    //also put 100+ other textboxes that are on this form
                }
               
                else
                {
                    <td>@Html.DisplayFor(modelItem => item.ProjectID)</td>
                    <td>@Html.DisplayFor(modelItem => item.CreatedBy)</td>
                    //also put 100+ other textboxes that are on this form
                }
            }

            @if(item.WorkFlowStage == '3')
            {
                if (User.IsInRole("BUICK_Tech"))
                {    
                    <td>@Html.EditorFor(modelItem => item.CreatedBy)</td>
                    //also put 100+ other textboxes that are on this form
                }

                if (User.IsInRole("BUICK_LeadMan"))
                {    
                    <td>@Html.DisplayFor(modelItem => item.CreatedBy)</td>
                    //also put 100+ other textboxes that are on this form
                }
               
                else
                {
                    <td>@Html.DisplayFor(modelItem => item.ProjectID)</td>
                    <td>@Html.DisplayFor(modelItem => item.CreatedBy)</td>
                    //also put 100+ other textboxes that are on this form
                }
            }
0
Comment
Question by:finance_teacher
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39267440
Hi,

You can try Fluent Security - http://www.fluentsecurity.net/

Hope it helps u...
0
 

Author Comment

by:finance_teacher
ID: 39292872
I emailed fluentsecurity.net and they said their premade solution does not do this.

Any other ideas ?
0
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 500 total points
ID: 39294285
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now