Adding SF SecurityKey type editor to custom class


Author
Message
Edhy Rijo
E
StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi All,



I use the StrataFlix sample approach for some of my applications, and the StrataFlix uses a class named ActionLinkMenuItem.vb to substitute the standard ToolStrip menu with some nice links added on left side of the screen.



Adding Role Base Security to my application I had the need to control these Action Link Menu Items via a SecurityKey like many of the SF controls, so I when back to the SF source code and found how they created these properties for other controls and simply added to the ActionLinkMenuItem.vb class and voila! now all my Action Link Menu Items have a SecurityKey property linked to the SF SecurityKeyTypeEditor to allow me to lookup my security keys and assign it to this control.



So here is the property code which you can find in the SF source:



Private _SecurityKey As String = ""

'''

''' Sets the permission key using the SF SecurityKey type editor

'''



DefaultValue(""), _

Description("The permission key used to determine whether the current user has permission to action assigned to this menu."), _

Editor(MicroFour.StrataFrame.Extensibility.Constants.TE_SecurityKeyTypeEditor, GetType(UITypeEditor))> _

Public Property SecurityKey() As String

Get

Return _SecurityKey

End Get

Set(ByVal value As String)

_SecurityKey = value

End Set

End Property





Of course this can be added to any custom class we may need to extend to make our life easier. If you copy this code just make sure to replace the with your own description.

Edhy Rijo

Russell Scott Brown
Russell Scott Brown
StrataFrame User (246 reputation)StrataFrame User (246 reputation)StrataFrame User (246 reputation)StrataFrame User (246 reputation)StrataFrame User (246 reputation)StrataFrame User (246 reputation)StrataFrame User (246 reputation)StrataFrame User (246 reputation)StrataFrame User (246 reputation)
Group: Forum Members
Posts: 124, Visits: 597
Thanks.  This is very helpful.

Russ Brown (Using C#2010/SQL Server 2008)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search