简体   繁体   English

WCF方法不同用户的可访问性

[英]WCF methods Accessibility for different user

We have 4 methods (A, B, C, D) in our service contract; 我们的服务合同中有4种方法(A,B,C,D); now we have to show A & B method to user1 on client side & C , D method to user2. 现在我们必须在客户端向用户1显示A和B方法,向用户2显示C和D方法。

How we can achieve that? 我们如何实现这一目标?

I suggest not messing with contracts but rather, using authorization. 我建议不要搞乱合同,而要使用授权。 In other words, let everyone see the same contract but restrict access to individual methods depending on WHO calls your service (which user, which role). 换句话说,让每个人看到相同的合同,但根据WHO呼叫您的服务(哪个用户,哪个角色)来限制对单个方法的访问。

There are dozen of ways to authenticate/authorize WCFs and you probably need to research this for your own and then possibly you could come back with specific questions. 有多种验证/授权WCF的方法,您可能需要自己研究它,然后可能会遇到一些具体问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM