Restrict the method (OperationContract) to be not availble for some user. [Resolved]

Posted by Kundan64 under WCF on 1/15/2013 | Points: 10 | Views : 3138 | Status : [Member] | Replies : 6
I have a svc file contains many method, I want to restrict some method (OperationContract) to be not availble for some user, but must be available for some other users, then what to do? If we use Sealed then it will not be available for any users.




Responses

Posted by: Shubham on: 1/15/2013 [Member] Starter | Points: 25

Up
0
Down
Hi!!!! Kundan64
plz provides different authorization for different user

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Kundan64, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kundan64 on: 1/15/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Shubham
can you explain it, or can give some web links for how to implement it?

Kundan64, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shubham on: 1/15/2013 [Member] Starter | Points: 25

Up
0
Down
ok you want code in wcf right???

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Kundan64, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 1/15/2013 [Member] [MVP] Gold | Points: 25

Up
0
Down
Try this
// Only members of the "User1" group can call this method.

[PrincipalPermission(SecurityAction.Demand, Role = "User1")]
[OperationContract]
bool Write();


Please Mark As Answer if this helps you

.

Kundan64, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kundan64 on: 1/15/2013 [Member] Starter | Points: 25

Up
0
Down
@Shubham, yes want code and some tutorials for this type of work.

Kundan64, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response