How to show the RBS Deny message programmatically?


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
Well, it is time to get into the RBS (even without printed documents BigGrin).  I have some menu options that will call SF features like MicroFour.StrataFrame.Data.ConnectionManager.ShowAvailableConnectionStrings().

I created a Security Permission named "DatabaseConnection" and assigned a Deny action to some Users, now here is the code I am using to test the security and show the Available Connection Strings form:

Private Sub SetDatabaseConnection()

     Dim customViewSecurityKey As String = "DatabaseConnection"

     If SecurityBasics.CurrentUser.GetPermission(customViewSecurityKey).Action = PermissionAction.Deny Then

          '-- Establish locals

          Dim loEventArgs As CheckSecurityEventArgs

          '-- Create the event args

          loEventArgs = New CheckSecurityEventArgs(customViewSecurityKey)

          '-- Raise the denied event

          Me.OnSecurityDenied(New SecurityDeniedEventArgs(customViewSecurityKey, loEventArgs.PermissionInfo), True)

          Exit Sub

     End If

     '-- Show the connection dialog and allow a connection to be selected

     If MicroFour.StrataFrame.Data.ConnectionManager.ShowAvailableConnectionStrings() Then

          '-- Since a connection was selected, then all of the existing dialogs need to be closed

          ' since their connection is established to the original source.

          For Each loForm As Form In Me.MdiChildren

               loForm.Close()

               loForm.Dispose()

          Next

          '-- Force the connections to be reset

          MicroFour.StrataFrame.Data.ConnectionManager.SetConnections()

     End If

End Sub

I got part of the code that deals with Me.OnSecurityDeny from the SF BaseForm class.  This code is working fine, but I wonder this:

  1. Am I using this code correctly to show the Deny message?
  2. Or should I just simply be calling the Me.ShowMessageByKey(customViewSecurityKey)?
  3. Or is there a method somewhere that will accept the customViewSecurityKey and show the Deny Message form?

 



Edhy Rijo

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (484 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
Howdy Smile

You are typically going to use ShowMessageByKey to show a custom security denied message if you are setting up your permissions with a "Message Key" denied action message, otherwise, you would just do a ShowMessage() with the message text.

Either way, you can get the message key or the message text via SecurityBasics.CurrentUser.GetPermission("YourKey").BlockedMessageOrKey

Hope it helps!

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 Dustin,

Thanks for the clarification.

Edhy Rijo

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