DDD用户安全策略

编程入门 行业动态 更新时间:2024-10-25 08:28:06
本文介绍了DDD用户安全策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个看起来像这样一个RentalProperty类:

I have a RentalProperty class which looks something like this:

class RentalProperty { Money MonthlyRent; List<MaintainenceCall> MaintainenceCalls; }

这是我的理解,采用DDD改变MonthlyRent,我会得到RentalProperty,改变MonthlyRent财产,并调用RentalPropertyRepository.Save()。相同的处理将被处理,以增加新的MaintainenceCall。

From my understanding, using DDD to change the MonthlyRent, I would get the RentalProperty, change the MonthlyRent property, and call RentalPropertyRepository.Save(). The same process would be handled to add a new MaintainenceCall.

我的问题是,例如,一个杂工应该能够增加一个MaintainenceCall,但不应该被允许改变MonthlyRent。我应该如何实现这个(以及其他类似的)安全策略?

The problem I have is that, for example, a Handyman should be able to add a MaintainenceCall, but should not be allowed to change the MonthlyRent. How should I implement this (as well as other similar) security policy?

推荐答案

AOP。 PostSharp 是真的光滑这样的东西。

AOP. PostSharp is really slick for stuff like this.

由于安全确实是一个跨部门的关注。

Because security is really a cross-cutting concern.

更多推荐

DDD用户安全策略

本文发布于:2023-08-01 15:42:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1269581.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:安全策略   用户   DDD

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!