Problem with loading authorization rules from database

Problem with loading authorization rules from database

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


Little_Irin posted on Thursday, October 29, 2009

Hello! I need to load authorization rules from database using CSLA 3.7.0 in Silverlight 3.0 application. I plan using FieldManager and both property-level and object-level permissions.
I've written a simple RolePermissionList class inherited from NameValueListBase.
Key for this dictionary is name of object type, and value contains permissions which various roles have for different object properties.
And each time object is instantiated,its RolePermissionProperty is loaded from RolePermissionList.
But my problem is that I can't load authorization rules in AddAuthorizationRules method, because RolePermissionProperty is not set for ApplicationContext.ExecutionLocation equals "Silverlight".
Where should I load them?


RockfordLhotka replied on Thursday, October 29, 2009

What is RolePermissionProperty?

It seems to me that at some point (before other objects get instantiated) you'll need to make a data portal call to get your RolePermissonList object from the server.

This wouldn't be real hard, except that Silverlight is asynchronous. So you'll have to take steps to make sure the app doesn't let the user actually do anything until that object has been retrieved.

Copyright (c) Marimer LLC