在n层应用程序上通过mvc的Servicestack安全性

时间:2013-07-02 19:42:09

标签: asp.net-mvc-3 security c#-4.0 servicestack

.net安全性的一个最大缺点是安全注释并不存在于mvc控制器之外。

CustomerController致电CustomerService来电CustomerRepository

以上每个都在不同的dll中。 我希望使用注释保护CustomerService,而不是CustomerController

  1. 是否可以在servicestack上进行?是不是很好的做法?
  2. 是否有任何带有servicestack的n层架构示例?
  3. 感谢

1 个答案:

答案 0 :(得分:1)

可以在servicestack上进行吗?这是好的做法吗?
在ServiceStack you can apply authentication/authorization attributes at different levels内(请求Dto,服务操作,服务类或Serivce的基类)。您也可以创建Filter Attributes

是否有任何带有servicestack的n层架构示例?
This is not so much an example但是ServiceStack项目的典型布局结构。