ReadOnlyBase Authorization Rules

ReadOnlyBase Authorization Rules

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


JoeFallon1 posted on Monday, January 29, 2007

The constructor in ReadOnlyBase does not have the SyncLock code like Business Base does.

Same problem exists for:

Private Sub OnDeserializedHandler(ByVal context As StreamingContext)

Is this a bug?

=====================================================

ReadOnlyBase:

Protected Sub New()
  Initialize()
  AddInstanceAuthorizationRules()
 
If Not Csla2.Security.SharedAuthorizationRules.RulesExistFor(Me.GetType) Then
   
AddAuthorizationRules()
 
End If
End Sub

=====================================================

BusinessBase:

Protected Sub New()
  Initialize()
  ...
  AddInstanceAuthorizationRules()
 
If Not Csla2.Security.SharedAuthorizationRules.RulesExistFor(Me.GetType) Then
   
SyncLock Me.GetType
     
If Not Csla2.Security.SharedAuthorizationRules.RulesExistFor(Me.GetType) Then
       
AddAuthorizationRules()
     
End If
   
End SyncLock
 
End If
End Sub

=====================================================

On a side note: since the constructor and OnDeserialized both have large chunks of the same code shouldn't that code be re-factored into a separate Sub which can be called from both of them?

Joe

JoeFallon1 replied on Wednesday, January 31, 2007

Rocky,

Looking for some feedback on this too.

Joe

RockfordLhotka replied on Wednesday, January 31, 2007

Fixed in 2.1.3.

Copyright (c) Marimer LLC