The comapny I work for is building an application using the CSLA framework and an issue I have come up with and would like some help with is as follows:
We have a User business object and 2 built in system users that we want to stop the setting of to inactive and a number of other fields, so I created some authorization instance rules, but the user object is never completed before the AddInstanceAuthorizationRules method is called.
On the following shared function the dataportal fetch occurs after AddInstanceAuthorizationRules method is called and I test whether the instance is a system user. The problem is the Is System User field is not set at this stage.
Public
Shared Function GetUser(ByVal UserId As Integer) As UserProtected
Overrides Sub AddInstanceAuthorizationRules()Thanks
Sorry about resurrecting this old post but I have a similar question... Why is AddInstanceAuthorizationRules fired before a (dataportal) fetch? I fully agree with the above statement about properties but in my case I have a following structure:
Customer : BusinessBase<Customer>
|------->ShortCustomer : Customer
|------->FullCustomer : Customer
And I have lots of branches that have customers. So each customer has a Branch property and there are security checks on what users can edit on customers of specific branches. All other behaviour is common accross branches.
I can add the checks in CanWriteProperty but thought it would be neater to be placed in AddInstanceAuthorizationRules.
Copyright (c) Marimer LLC