StrataFrame Forum

ViewSecurityKey in InheritsForm

http://forum.strataframe.net/Topic21488.aspx

By Malcon M. Mikami - 1/13/2009

By testing the safety of the form in an inherited form, the property in the form ViewSecurityKey "son" does not work, only the form of "father

Any suggestions?

By Greg McGuffey - 1/13/2009

Not sure what you mean by doesn't work. Are you using role based security? Check out the "Form-Level Security Keys" help topic to see how it should work. There's a table at the bottom outlining what should be happening.
By Trent L. Taylor - 1/13/2009

I really don't understand either.  Greg had some good questions, please answer.  Thanks.
By Malcon M. Mikami - 1/13/2009

Excuse my poor English. Let me explain better:
I have 2 forms:
frmMaster = "father" and frmAccounts = "son".
The form frmAccounts inherits the form frmMaster
My project is using the integrated security of Strata. When I put the key in the form of ViewSecurityKey property frmMaster it works is the key for permission. When I put the key in the same form he frmAccounts not the key to encotra permission. What may be happening?
By Malcon M. Mikami - 1/13/2009

Excuse my poor English. Let me explain better:
I have 2 forms:
frmMaster = "father" and frmAccounts = "son".
The form frmAccounts inherits the form frmMaster
My project is using the integrated security of Strata. When I put the key in the form of ViewSecurityKey property frmMaster it works is the key for permission. When I put the key in the same form he frmAccounts not the key to find permission. What may be happening?
By Greg McGuffey - 1/13/2009

No problem with the poor English BigGrin



You aren't overloading or overriding the property are you? ViewSecurityKey is actually implemented way down in the SF BaseForm, with is sub-classed by the SF StandardForm, which your master form is using....so I don't know why it wouldn't work for one more level. So it probably likely that you are doing something on the accounts form that is messing things up. Ermm



I'd try a couple of things to narrow down the problem. First, check our security key and also the user your testing with, make sure everything is setup correctly. Next, if you have another form that is inherited from master, attempt to do the same security on it (temporarily, just for testing). If that also does not work, I'd create a new form with no code, just the security key, inherit from master. If that does not work, create a sample app, see what happens.



Also, what exactly is it doing? Always opening? Throwing an exception?
By Malcon M. Mikami - 1/13/2009

Solved!
In Form father in contrutor method, has the following command:

InitializeComponent ();
this.Visible = false; <------

The method. He calls the checksecurity visible, but the key is empty because the form has not been initialized.

Removed the visible, everything OK
 
Tanks boys~!
By Ivan George Borges - 1/13/2009

There... I'm not useful even to translate posts anymore... BigGrin

Good you got it working, Malcon.

By Greg McGuffey - 1/13/2009

Cool. Glad you found the problem!



Ivan, don't get down. I was *almost* about to yell uncle, but Malcon got it working too soon! Wink