How to allow read only for a certain type of user?

1

I have a button that triggers an event to close a school's school year. By clicking this button, the person can have access to all screens of the system, but can not edit anything, delete, insert. Is there a way to block only these functions for the user so that they do not have to validate screen by system screen?     

asked by anonymous 05.05.2014 / 23:33

2 answers

0

If you are using Windows Form, you can declare a global variable called UserString and then create a method to check it and if the user type is not the administrator, change the Enable property of each Form.

    
08.05.2014 / 05:01
3

I would do something like this (ASP.NET MVC in Razor + jQuery):

@section scripts {
    @if (User.IsInRole("Diretores")) {
        <script>
            $(document).ready(function() {
                $("input, select, textarea").attr("disabled", "disabled");
            });
        </script>
    }
}
    
05.05.2014 / 23:53