ObjectAuthorizationRules system perfomance

ObjectAuthorizationRules system perfomance

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


lazaroms posted on Sunday, August 01, 2010

Hello everybody:

I have a doubt concerning to the Project class in the PTracker.

The developer implemented a function like this:

   Public Shared Function CanAddObject() As Boolean

    Return Csla.ApplicationContext.User.IsInRole("ProjectManager")

  End Function

Is that function the same that doing the following?

  Protected Shared Sub AddObjectAuthorizationRules()

    AuthorizationRules.AllowCreate(GetType(Project), "ProjectManager")

  End Sub

and, when needed, asking for Csla.Security.AuthorizationRules.CanCreateObject(GetType(Project))

Is perfomance the reason for the change?

 

Thanks.

 

L.M.Santin

 

 

RockfordLhotka replied on Sunday, August 01, 2010

That is just a bug - some older code I forgot to update to the more modern technique.

Copyright (c) Marimer LLC