AddAuthorizationRules not firing?

AddAuthorizationRules not firing?

Old forum URL: forums.lhotka.net/forums/t/5848.aspx


ajj3085 posted on Friday, November 21, 2008

Hi,

I have the following class hierarchy:

Invoice : Document

Document : Core.MyBusinessBase

MyBusiness : Csla.Core.BusinessBase

I also have AddAuthorizationRules overriden in only the Document subclass, but it doesn't seem to be firing.  I know it used to, I discovered it wasn't recently though.  The application is using Csla 3.5.1 RTW.

Any ideas?  Would the fix be the _dummy static variable?  Any ideas why it used to work in prior versions of Csla?

Thanks
Andy

RockfordLhotka replied on Saturday, November 22, 2008

I don't know why it wouldn't be firing - it should fire, and should have nothing to do with forcing initialization of static fields.

ajj3085 replied on Monday, November 24, 2008

Looking into this more... for some reason the first call to Csla.Security.SharedAuthorizationRules.RulesExistFor( typeof( Invoice ) ) is returning true... even though rules have never been added for the type.  When I first create a Quote, that method returns false, and AddAuthorizationRules is called properly.

ajj3085 replied on Monday, November 24, 2008

Ok, I found the issue.  In my Invoice class, I override AddBusinessRules, but call AuthorizationRules.AllowExecute. 

Copyright (c) Marimer LLC