[Lazarus] allow/Deny user to show form

Anthony Walter sysrpl at gmail.com
Wed Feb 15 18:22:57 CET 2017


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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170215/dfe976a5/attachment.html>


More information about the Lazarus mailing list