in Education by
I want to make custom attributes on classes to restrict who calls them. For example: [Permission("Admin")] public class MyData { .... How to do that? So I want to really make some sort of Permission-class. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You either use the ones that already exist, or you write your own and hook them into the Code Access Security architecture. This has been around for a really long time, and I was able to find these articles: Code Access Security Creating Your Own Code Access Permissions Cut-away from the link above: Implementing a custom code access permission involves the following steps, some of which are optional. Each step is described in a separate topic. Design the Permission class. Implement the IPermission and IUnrestrictedPermission interfaces. Implement the ISerializable interface, if necessary for performance or to support special data types. Handle XML encoding and decoding. Add support for declarative security, by implementing an Attribute class. Demand custom permission for your permission, where appropriate. It's really steps 1, 2, 5 and 6 that are of interest to you.

Related questions

0 votes
    Which are the attributes of Container Managed Security?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    What are partial classes in C#?...
asked Jul 9, 2021 in Technology by JackTerrance
0 votes
    What are sealed classes in C#?...
asked Mar 31, 2021 in Education by JackTerrance
0 votes
    What all do you usually do while you are connected to the net? Make a list of all the security measures ... to safeguard yourself. Select the correct answer from above options...
asked Dec 30, 2021 in Education by JackTerrance
0 votes
    im developing a c# application (Photo Album Viewer), Im having Picturebox (Displays the selected image in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    Q: I allow my user to upload an xml file to insert its contents in my database. I ask if there' ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Q: I allow my user to upload an xml file to insert its contents in my database. I ask if there' ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Q: I allow my user to upload an xml file to insert its contents in my database. I ask if there' ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Question No.1: What do you understand about container tag and empty tag, give example? Question No.2: What do ... all the attributes? Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
0 votes
    I wanted to find a way to extract from the url the classes to be added to the body. I made some ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I wanted to find a way to extract from the url the classes to be added to the body. I made some ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Which of these standard collection classes implements all the standard functions on list data structure? (a) Array ... of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which design pattern suggests multiple classes through which request is passed and multiple but only relevant classes carry ... of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
...