I would like to add the logged in user's user_id to the application object when they log in


I would like to add the logged in user's user_id to the application...
Author
Message
Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
So can you help me with this Smile ?

Thanks

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I don't quite understand your question, but in case this may help you, I have a method that will show up the current logged user in a ThemedLinkMenuItem:

AddHandler MicroFour.StrataFrame.Security.SecurityBasics.CurrentUserChanged, AddressOf UpdateCurrentUserInfo

 

''' <summary>

''' Update the Current User info on the main form.

''' </summary>

''' <remarks></remarks>

Private Sub UpdateCurrentUserInfo()

     '-- Show the current logged user info.

     Dim currentUserName As String = MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO.RetrieveFullName(SecurityBasics.CurrentUser.UserPK, False)

     If SecurityBasics.CurrentUser.UserName.Equals("Administrator", StringComparison.CurrentCultureIgnoreCase) Then 

          currentUserName = SecurityBasics.CurrentUser.UserName

     End If

     Me.tlmUserInfo.ItemCollection("CurrentUser").Title = currentUserName

     Me.tlmUserInfo.ItemCollection("LoggedOnValue").Title = SecurityBasics.CurrentUser.LoggedOnAt.ToString

End Sub



Edhy Rijo

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Edhy Rijo (10/29/2008)
I don't quite understand your question, but in case this may help you, I have a method that will show up the current logged user in a ThemedLinkMenuItem:

AddHandler MicroFour.StrataFrame.Security.SecurityBasics.CurrentUserChanged, AddressOf UpdateCurrentUserInfo

 

''' <summary>

''' Update the Current User info on the main form.

''' </summary>

''' <remarks></remarks>

Private Sub UpdateCurrentUserInfo()

     '-- Show the current logged user info.

     Dim currentUserName As String = MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO.RetrieveFullName(SecurityBasics.CurrentUser.UserPK, False)

     If SecurityBasics.CurrentUser.UserName.Equals("Administrator", StringComparison.CurrentCultureIgnoreCase) Then 

          currentUserName = SecurityBasics.CurrentUser.UserName

     End If

     Me.tlmUserInfo.ItemCollection("CurrentUser").Title = currentUserName

     Me.tlmUserInfo.ItemCollection("LoggedOnValue").Title = SecurityBasics.CurrentUser.LoggedOnAt.ToString

End Sub

I take it that this code requires that I have the Role Based Security module installed. Since I do not, this could be a problem Tongue

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Marcia G Akins (10/29/2008)
I take it that this code requires that I have the Role Based Security module installed. Since I do not, this could be a problem Tongue

If you are not use RBS, then are you talking about Windows Logged User? if that is the case, I have not done that yet, but there are plenty of info in google on how to read the Windows current user.

Edhy Rijo

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Edhy Rijo (10/29/2008)
Marcia G Akins (10/29/2008)
I take it that this code requires that I have the Role Based Security module installed. Since I do not, this could be a problem Tongue

If you are not use RBS, then are you talking about Windows Logged User? if that is the case, I have not done that yet, but there are plenty of info in google on how to read the Windows current user.

No, I am not talking about Windows Logged User. My application has its own log in form and it has a table of application users in SQL server.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Marcia,



Well, you could just take a play out of the SF playbook and in your login code, raise a CurrentUserChanged event. Then handle this event to update whatever you need to.



As to were to save this off, you'd probably want to save it way down in a base/library class, that every other class is already referencing anyway (this should probably be were the other security code is also). SF uses static class/method to do this, so it is easy to access from anywhere: SecurityBasics.CurrentUser. This works very well, so if I had to roll my own security, I'd likely follow this sort of design. Does that make sense/help?



Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Greg McGuffey (10/29/2008)
Marcia,

Well, you could just take a play out of the SF playbook and in your login code, raise a CurrentUserChanged event. Then handle this event to update whatever you need to.

As to were to save this off, you'd probably want to save it way down in a base/library class, that every other class is already referencing anyway (this should probably be were the other security code is also). SF uses static class/method to do this, so it is easy to access from anywhere: SecurityBasics.CurrentUser. This works very well, so if I had to roll my own security, I'd likely follow this sort of design. Does that make sense/help?

Sort of. Thanks for your input.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Basically he is telling you that since you have your own security to write your own logic that the RBS already has built in.  The SecurityBasics is totally useless of you are using RBS.  But what Greg was referring to is that we have a CurrentUserChanged shared event that can be handled and is raised when the logged in user is changed.  When this happens, the CurrentUser information along with all of their permissions, etc. are updated.  This ensures that you can always and reliably use the CurrentUser PK, user name, permissions, etc. and it is all event driven.  We have tapped into this event for a number of different purposes in our medical application which makes updating the environemtn based on the current users permissions much easier.  Also, we have a user stamp column on every table in our system so we can see which user created every record in our entire application.  There are a lot of benefits, but Greg was just trying to explain how the SF RBS works so you could write your own since you are already going down this road.
Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (10/30/2008)
Basically he is telling you that since you have your own security to write your own logic that the RBS already has built in.  The SecurityBasics is totally useless of you are using RBS.  But what Greg was referring to is that we have a CurrentUserChanged shared event that can be handled and is raised when the logged in user is changed.  When this happens, the CurrentUser information along with all of their permissions, etc. are updated.  This ensures that you can always and reliably use the CurrentUser PK, user name, permissions, etc. and it is all event driven.  We have tapped into this event for a number of different purposes in our medical application which makes updating the environemtn based on the current users permissions much easier.  Also, we have a user stamp column on every table in our system so we can see which user created every record in our entire application.  There are a lot of benefits, but Greg was just trying to explain how the SF RBS works so you could write your own since you are already going down this road.

No - eventually I am going to purchase your role based security module because it is going to be cheaper for my client than having me write one from scratch Smile

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (10/30/2008)
Basically he is telling you that since you have your own security to write your own logic that the RBS already has built in.  The SecurityBasics is totally useless of you are using RBS. 

OK - I hate to be stupid but I just purchased the RBS module. Now how do I activtivate the license?

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