Unable to Add Or Edit Permissions


Author
Message
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
I started my database by using a copy of the Strataframe Example database which had the Security tables.  I open the Security Dialog box through code (see below).  The editor allows me to add/edit users and roles, but not permissions.  What is wrong?

Program.cs Code:

System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder();

builder.DataSource =
"1LPJPAGLEY\\SQLEXPRESS";

builder.InitialCatalog =
"CEI";

builder.UserID =
"sa";

builder.Password =
"access";

DataLayer.DataSources.Add(new SqlDataSourceItem("", builder.ConnectionString));

//Set the data source key for the security tables

SecurityBasics.SecurityDataSourceKey = "";

 

Form Code:

MicroFour.StrataFrame.Security.SecurityDialog frm = new MicroFour.StrataFrame.Security.SecurityDialog();

frm.ShowDialog();


Thanks,

Jeff
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You are not allowed to add or edit permissions at run-time by default, only at design-time.  It doesn't make sense for the end-user to create their own permissions as you the coder, have to implement the permissions in the application.  For example, if you create a permission named "LetMeIn", you as the developer have to implement that permission in your code logic someplace to be useful.  In this example, let's say it is a form, so you would have to open your form in the designer and set the security permission to "LetMeIn."  Once you compile and run, the form knows to look and test on that permission.

Technically you can call the SecurityDialog and have it allow permissions, but it really doesn't make any sense.  But to show the permissions and the restriction sets, you would do this:

C#
MicroFour.StrataFrame.Security.SecurityDialog securityForm = new StrataFrame.Security.SecurityDialog(true, true);
securityForm.ShowDialog();


VB.NET
Dim securityForm As New MicroFour.StrataFrame.Security.SecurityDialog(True, True)

securityForm.ShowDialog()

Edited 14 Years Ago by Trent L. Taylor
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Trent,

Yes, I understand why the permissions are not available to add/edit to the end user.  However, I am trying to setup the initial permissions in the security tables in my database during my development.  I added the (true, true) parameter values.  It still does not allow me to add/edit the permissions!?!? 

Also, the other reason why I need this ability is I am going to need to be able to allow an administrator to add permissions for future updates of the software at a remote site.  How does other developers handle adding permissions to their databases once the app and database has been deployed?

Thanks,

Jeff
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Are you going into the Security Editor through Visual Studio?

  1. Open Visual Studio
  2. Click StrataFrame -> Role Based Security Editor
If you are not working off of a project then the permissions can't be shown.  The only way to work off of a project in this case to add permissions is through VS.
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
OK.  Then how do I point the IDE RBS Editor to the security tables in my database instead in the Strataframe database?

Jeff
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Jeff,

How are you developing?  It is generally not a good idea to work off of your production or distribution database. The easiest and best way is to let the DDT do it for you.  It will package up all of your security tables and deploy them to your production environment.  There is a wizard that will create the deployment data packages for you and then deploy them to your production environment.  This also provides you with a distribution mechanism.  Even if you are writing an internal application, you will still want to work this way.  If you don't want to use the DDT, then you will want to do what the DDT does for you and extract them from the Security tables in the StrataFrame database and import them into your production database.  Using the DDT does this for you in seconds though, so it is really the route you will want to take.
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
I have not deployed the production database yet.  I am still working on the developing the database.  However, I have not used the DDT.  So what you are saying is once I develop my production database then I can add the security tables and their records from the Strataframe database to my production database using the DDT, correct?  What if I have two or more projects in the RBS Editor system for different development applications I am working on.  Will the DDT enable me to deploy the security tables and only the records associated with the security project which is setup for the application I am deploying? 

Jeff
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Working backwards, if you have two projects then you need to create 2 security projects.  Once for each, so if you set this up correctly, then yes, you can distinguish between each project and deploy them appropriately.  When you create the permissions, then you just pop over to the DDT, repackage, then deploy data only (after the tables have been created) to update your database with the appropriate permissions.
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Trent,

I just realize why I wanted the security tables local to my development database.  I wanted to use the user PKs from the security user table for other tables like user departments, user schedules and etc.  What do you suggest?

Jeff
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
We do the same thing, we store the user PK on every record created on every table in our entire system.

MicroFour.StrataFrame.Security.SecurityBasics.CurrentUser.UserPk


Going for memory on the above code, but that will give you the currently logged in user.  You will then use the BO's SetDefaultvalues event to set the user PK on your records when a new row is created.  This then becomes an automated process in your application.
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