StrataFrame Forum

Getting an error when assignign permission to user

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

By Ivan George Borges - 10/13/2006

Hya.

This is what I'm getting when I choose the Restriction from the dropdown control:

NullReferenceException
 Object reference not set to an instance of an object.

Source     : MicroFour StrataFrame Security

Stack Trace:
   at MicroFour.StrataFrame.Security.UserEditor.SaveData(TreeNode Node, SetDataPiece SetPiece)
   at MicroFour.StrataFrame.Security.UserEditor.cboRestriction_SelectedValueChanged(Object sender, EventArgs e)
   at System.Windows.Forms.ListControl.OnSelectedValueChanged(EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectedValueChanged(EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Anything I should look at?

By StrataFrame Team - 10/13/2006

I can't make it fail on this end, Ivan.

Is there any other information you can give me?  Is this a new user, or one you're editing?  Are you adding the restriction set to a category, the top node, or an individual permission, etc...

By Ivan George Borges - 10/13/2006

Hi Ben.

Didn't do anything special ... created the user, then a role, then created a restriction. Went back to the user, edited him, permission tab, restriction dropdown, chose the one just created, and "boom".

By StrataFrame Team - 10/13/2006

I'll see what I can do to replicate it.  Thanks, Ivan.
By Ivan George Borges - 10/16/2006

Hi Ben.

Do you think there is something I could try here?

By Ivan George Borges - 10/16/2006

Hi Ben.
 
I just realized something ...regarding the error above, I just noticed I don't have the Permission buttons in the Security Toolbar! Nor the Permission options in the ContextMenu...
By StrataFrame Team - 10/17/2006

The reason you don't have the permission buttons is that you are opening the SecurityDialog at runtime... and end-users are not allowed to modify permissions at runtime because that's developer-only territory.  However, if you are opening the security editor from the Visual Studio menu, and you do not see the permission menu options listed, then this is a problem Wink
By Ivan George Borges - 10/17/2006

Sorry ... Blush

So that's the reason for the issue ... if someone extremely clever like me tries to assign a Permission without having inserted one first, the Exception is thrown. Thanks for not showing a "You moron, create a permission first" message. BigGrin

So, I need to run the security from the Visual Studio, create everything and then use the DDT to import this tables and deploy to the app, is that it?

Thanks Ben, you guys will go straight to heaven.

By StrataFrame Team - 10/17/2006

Yes, you create the permissions through the editor at design-time and then you can assign them to users at runtime after you deploy the data with the DDT (or scripts, or whatever).