Hi there.
I'm having a trouble with the authorization system of my application.
I persist the users, roles and permission per role on a MySQL database.
I'm trying to assign permission by object type:
- Menu option (Cool Vista-style menu by Nedim Sabic, great control by the way)
- Forms (I developed a basic form and inherit from that all the other forms)
- Buttons (all the buttons are inherited from a basic class too).
At my base form class, at the LOAD event, I'm checking the authorization for the specific user (based on his/her role):
if (!Autorizaciones.Autorizado(this.Name, _Padre))
{
Autorizaciones.Error();
Close();
}
But (always a but), even if this works correctly, the form is shown for a few milliseconds.
Is it possible to prevent the creation of the form (or any other object) using another event?
Thanks in advance.
VS2008
MySQL 5.5.10
.NET FrameWork 3.5