locked
creating custom permission attribute RRS feed

  • Question

  • User1856468055 posted

    Hi,

    In my webservice I have different webmethods. To each method I want to apply a custom permission attribute something like this:

    ["MyPermission"]
    public string MyWebMethod1()
    {
       //Do something
    }
    
    ["MyPermission1, MyPermission2"]
    public string MyWebMethod2()
    {
       //Do something
    }
    
    

    I have a function which lists the permissions allowed for a method. 

     - How can I create the above custom permission

     - How can I check for the allowed permission for this method by checking the permission attribute defined at the top of webmethod

    Thanks

    Friday, March 13, 2015 12:37 PM

All replies