What you probably should do is create a function to show a form of any class for you, and put that security check in that one place.
Example: function ShowForm(FormClass: TFormClass; Modal: Boolean = False): Boolean; begin // your global function to check if a user can access a form class Result := UserSecurityCheck(FormClass); if Result then // make sure FormClass close action is caFree with FormClass.Create(Application) do if Modal then Result := ShowModal = mrOk else Show; end;
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus