Authorization bug (?) in Rolodex sample

Authorization bug (?) in Rolodex sample

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


triplea posted on Wednesday, April 01, 2009

I am playing with the Rolodex sample (with CSLA 3.6.2 RC - site is currently down and cannot donwload the release version yet) and noticed a bug. If I log in as User/user and click on "Add Company" the app will happily take me to the company edit screen. There of course I cannot save since the Save button is disabled. Then if I click Close and again Add Company, I get the authorization message telling me I cannot create a new company - twice.

It appears that AddAuthorizationRules() is called after the initial call to CreateCompany (even after the call to DataPortal_Create) has finished so the first time the authorization check on AllowCreate is missed. This brings back memories of the _dummy field but I am still getting to grips with 3.6.x so not entirely sure...

Copyright (c) Marimer LLC