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
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
So can you help me with this Smile ?

Thanks

Replies
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Ok, Trent. Now you really asked for it Tongue

I already have a table in my existing application to store user names and another for their roles. Can I continue to use my tables and still hook into RBS just for the purposes of saving the current users login id?

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Ehhh....that could be tough.  Not saying it is impossible, but you will have to "sync" up the SFSUsers and your users tables so that RBS authenticates off of the SFSUsers versus your users.  What I would do is just write a conversion program that is run the first time the app is executed with the RBS that converts your existing users and roles into the RBS users tables and sets their permissions.  That is going to be easier than tryin to make two different applications work together.
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (10/30/2008)
Ehhh....that could be tough.  Not saying it is impossible, but you will have to "sync" up the SFSUsers and your users tables so that RBS authenticates off of the SFSUsers versus your users.  What I would do is just write a conversion program that is run the first time the app is executed with the RBS that converts your existing users and roles into the RBS users tables and sets their permissions.  That is going to be easier than tryin to make two different applications work together.

Hmmm. That is an idea. I could actually synch up the existing data myself before I give the client the next build. Then I suppose I could add some code to my Users form to update the RBS data with the user data that has been added or edited. It is unlikely that they will add new roles, but just in case they do, I could add code to update the roles in RBS. Do you think that would work? The only snag I can see is that the PK's have to match.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
That should work...the only thing that I don't understand is why PKs would have to match...unless you are storing these off presently in other tables for auditing purposes...then I could see that.  But as for authentication, it won't matter.
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (10/30/2008)
That should work...the only thing that I don't understand is why PKs would have to match...unless you are storing these off presently in other tables for auditing purposes...then I could see that.  But as for authentication, it won't matter.

OK - I see what you are getting at. Later, when I implement audit loggin, I can let then view the log by user as the user is stored in RBS.

I have been heads down in the RBS documentation to see how I add security to my app but I must have taken my stupid pills today Tongue I cannot see how to get started. It looks like I have to add a new security project to my solution. Is that correct?

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
No, you can retro-fit the security into your application.  But the easiest way to figure out what to add is to create a new security project, then open up the Appmain.vb or program.cs depending which language you are using, and rob the code out of there that is security specific and then add it into your application.
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (10/30/2008)
No, you can retro-fit the security into your application.  But the easiest way to figure out what to add is to create a new security project, then open up the Appmain.vb or program.cs depending which language you are using, and rob the code out of there that is security specific and then add it into your application.

Thanks. I will try that. Just in case there is a problem, I have already backed up my existing application BigGrin

Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (10/30/2008)
No, you can retro-fit the security into your application.  But the easiest way to figure out what to add is to create a new security project, then open up the Appmain.vb or program.cs depending which language you are using, and rob the code out of there that is security specific and then add it into your application.

I can tell that this is going to be another one of those days Sad

I created the new security project and then tried to enter roles using the security editor. Even though I ran the script to add the SFS* tables to my application database, when I added the roles, the application added them to the tables in the StrataFrame database. What do I need to do to get the security editor to add the users. roles, etc to the tables in my database?

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
When you use the Security editor via the SF menu, you will pick/create a project. The data is then stored in the SF database, using the project to keep things separate. When you update roles/permissions this way, you will then need to deploy the security data to your database.



The easiest way to do this is to use the DDT to manage it. However, I believe that if use it and have your security tables in your app database, you have to also use the DDT to manage deployment of your entire database (I think the newest versions allow for custom/non-DDT sprocs and views, but I think all tables still need to be deployed via the DDT). If is the case for you, then open the DDT and just redeploy the database. Typically, when you add the security tables to the DDT, it adds the appropriate data packages also, so it is a snap.



If you aren't using the DDT, it gets more interesting. If you use the security editor via VS or the SF menu to update roles, then you need to move the data out of the SF database yourself. I haven't done this...it just looked like too much fun and I have a weak liver Ermm For more help on deploying security data, see the "Deploying Security Data" topic in the RBS section of the help file.



What I've done is a hybrid. I just have two databases: one for the app and one for security. That way I can use scripts to manage my app database and DDT to manage the security database. When I started, there were reasons I chose not to use the DDT for my application database, but if I were to start out now, those reasons have diminished a lot, so I might just use the DDT for both now.



However, you can make a call to the security dialog within an app and then it uses the security key to identify the appropriate data source that contains the SFS* tables for your app. You'd use a call like this within a project setup for security:



using (SecurityDialog loDialog = new SecurityDialog())

{

  loDialog.ShowDialog();

}




See the "Calling the Security Maintenance Dialog" help topic in the RBS section of the help file for more info.



Even if you do this, you will still need to deploy the data from your dev environment to your test and then production environments. However, you could use this to skip the whole deployment thingy while figuring out the RBS at this stage.



Good luck!
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Greg McGuffey (10/30/2008)
When you use the Security editor via the SF menu, you will pick/create a project. The data is then stored in the SF database, using the project to keep things separate. When you update roles/permissions this way, you will then need to deploy the security data to your database.

The easiest way to do this is to use the DDT to manage it. However, I believe that if use it and have your security tables in your app database, you have to also use the DDT to manage deployment of your entire database (I think the newest versions allow for custom/non-DDT sprocs and views, but I think all tables still need to be deployed via the DDT). If is the case for you, then open the DDT and just redeploy the database. Typically, when you add the security tables to the DDT, it adds the appropriate data packages also, so it is a snap.

If you aren't using the DDT, it gets more interesting. If you use the security editor via VS or the SF menu to update roles, then you need to move the data out of the SF database yourself. I haven't done this...it just looked like too much fun and I have a weak liver Ermm For more help on deploying security data, see the "Deploying Security Data" topic in the RBS section of the help file.

What I've done is a hybrid. I just have two databases: one for the app and one for security. That way I can use scripts to manage my app database and DDT to manage the security database. When I started, there were reasons I chose not to use the DDT for my application database, but if I were to start out now, those reasons have diminished a lot, so I might just use the DDT for both now.

No, I am not using DDT. I just want to know how to point the security maintenance application to the SFS* tables that I have created in my application database. Obviously, my client does not have the Stataframe database on his site and it would be inconvenient to have his application blowing up when he tries to maintain users. I have search the documentation and I can't find anywahere that it tells me how to do this.

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Marcia.

Have a look at Role-Based Security / Defining Security within the Application / Deploying Security Data.

Then you will find a topic about Deploying Security Data Without the DDT.

But if I were you, I would consider getting the DDT too. Wink

Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Ivan George Borges (10/30/2008)
Hi Marcia.

Have a look at Role-Based Security / Defining Security within the Application / Deploying Security Data.

Then you will find a topic about Deploying Security Data Without the DDT.

But if I were you, I would consider getting the DDT too. Wink

I have my husband the DBA to handle the stored procedures Smile

I am pretty comfortable in SQL Server, so I really do not need it. I found the topic and I did run the script. My problem is that when I run the security maintenace form and run it, it populates the tables in the Strataframe database and not my application database. All I want to know is how to make it update the tables in my database and I can't seem to find an answer to that question anywhere.

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Whenever you run it from the VS IDE, you will get the data from the StrataFrame database.

You will have to script the import procedure to get that info from the SFS tables in the StrataFrame database and then append them to your client's database or to your testing database in you network. So, when you run the application and point it to its database, you will be speaking to the SFS tables in it.

Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Ivan George Borges (10/30/2008)
Whenever you run it from the VS IDE, you will get the data from the StrataFrame database.

You will have to script the import procedure to get that info from the SFS tables in the StrataFrame database and then append them to your client's database or to your testing database in you network. So, when you run the application and point it to its database, you will be speaking to the SFS tables in it.

OK - I finally did figure that one out. So I created a simple security based application with one form that called the maintenace form and got an error when I tried to save a new user saying that a solumn in my users table did not exist. So apparently the script provided to generate the tables in my database is not correct Sad

Thanks for the assistance.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
So apparently the script provided to generate the tables in my database is not correct.




I haven't upgraded to the latest version (1.6.6), but the link in my help file is to a script from 2006. There are no auditing tables in it, so looks like SF probably needs to provide a new script for the security tables.
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Greg McGuffey (10/30/2008)
So apparently the script provided to generate the tables in my database is not correct.


I haven't upgraded to the latest version (1.6.6), but the link in my help file is to a script from 2006. There are no auditing tables in it, so looks like SF probably needs to provide a new script for the security tables.

Well, I have given up on trying to integrate RBS into my app for now. I have too much stuff to work on so I can take this app live within the next week or so. I can deal with the discrepancies. I have my own set of utility programs that can create a working script (correctly - not like how SQL Server does it BigGrin ) from a set of tables.

When I have phase 1 finished, I will revisit the RBS integration.

Thanks for all the help Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Marcia G Akins - 17 Years Ago
Edhy Rijo - 17 Years Ago
Marcia G Akins - 17 Years Ago
Edhy Rijo - 17 Years Ago
Marcia G Akins - 17 Years Ago
                         Marcia,

Well, you could just take a play out of the SF...
Greg McGuffey - 17 Years Ago
                             [quote][b]Greg McGuffey (10/29/2008)[/b][hr]Marcia, Well, you could...
Marcia G Akins - 17 Years Ago
                                 Basically he is telling you that since you have your own security to...
Trent L. Taylor - 17 Years Ago
                                     [quote][b]Trent L. Taylor (10/30/2008)[/b][hr]Basically he is telling...
Marcia G Akins - 17 Years Ago
                                     [quote][b]Trent L. Taylor (10/30/2008)[/b][hr]Basically he is telling...
Marcia G Akins - 17 Years Ago
                                         Just open up the Activation client and deactivate your current...
Trent L. Taylor - 17 Years Ago
                                             [quote][b]Trent L. Taylor (10/30/2008)[/b][hr]Just open up the...
Marcia G Akins - 17 Years Ago
                                                 Ok, Trent. Now you really asked for it :P I already have a table in...
Marcia G Akins - 17 Years Ago
                                                     Ehhh....that could be tough. Not saying it is impossible, but you will...
Trent L. Taylor - 17 Years Ago
                                                         [quote][b]Trent L. Taylor (10/30/2008)[/b][hr]Ehhh....that could be...
Marcia G Akins - 17 Years Ago
                                                             That should work...the only thing that I don't understand is why PKs...
Trent L. Taylor - 17 Years Ago
                                                                 [quote][b]Trent L. Taylor (10/30/2008)[/b][hr]That should work...the...
Marcia G Akins - 17 Years Ago
                                                                     No, you can retro-fit the security into your application. But the...
Trent L. Taylor - 17 Years Ago
                                                                         [quote][b]Trent L. Taylor (10/30/2008)[/b][hr]No, you can retro-fit...
Marcia G Akins - 17 Years Ago
                                                                         [quote][b]Trent L. Taylor (10/30/2008)[/b][hr]No, you can retro-fit...
Marcia G Akins - 17 Years Ago
                                                                             When you use the Security editor via the SF menu, you will pick/create...
Greg McGuffey - 17 Years Ago
                                                                                 [quote][b]Greg McGuffey (10/30/2008)[/b][hr]When you use the Security...
Marcia G Akins - 17 Years Ago
                                                                                     Hi Marcia. Have a look at Role-Based Security / Defining Security...
Ivan George Borges - 17 Years Ago
                                                                                         [quote][b]Ivan George Borges (10/30/2008)[/b][hr]Hi Marcia. Have a...
Marcia G Akins - 17 Years Ago
                                                                                             Whenever you run it from the VS IDE, you will get the data from the...
Ivan George Borges - 17 Years Ago
                                                                                                 [quote][b]Ivan George Borges (10/30/2008)[/b][hr]Whenever you run it...
Marcia G Akins - 17 Years Ago
                                                                                                     [quote]So apparently the script provided to generate the tables in my...
Greg McGuffey - 17 Years Ago
                                                                                                         [quote][b]Greg McGuffey (10/30/2008)[/b][hr][quote]So apparently the...
Marcia G Akins - 17 Years Ago
Larry Caylor - 17 Years Ago
Larry Caylor - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Marcia G Akins - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                         [quote][b]Trent L. Taylor (10/31/2008)[/b][hr]If you only plan to have...
Marcia G Akins - 17 Years Ago
                             That would be the safest way to go. :)
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search