StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Security Editor does not openExpand / Collapse
Author
Message
Posted 12/21/2007 4:20:20 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 06/11/2008 7:29:38 AM
Posts: 6, Visits: 21
Hi,

I created an application with various forms and I created users, permission and assign permission to each user.

Everything works fine besides it that whenever I click on "SecurityEditor" button in my application it show me "Access Denied" pop up even user is autorized to open the security editor.

1. if (SecurityBasics.CurrentUser.GetPermission("Secure").Action == PermissionAction.Grant){

2. loForm = new SecurityDialog();

3. loForm.MdiParent = this;

4. loForm.Show();

5. }

6. else

7. {

8. MicroFour.StrataFrame.Messaging.MessageForm.ShowMessage("Access Denied", "Access 9. has been denied to the security editor.", ""

10. MicroFour.StrataFrame.Messaging.MessageFunction.OK,

11. MicroFour.StrataFrame.Messaging.MessagingIcon.Forbidden,

12. MicroFour.StrataFrame.Messaging.MessagingSounds.Warning);

13. }

Here debugger crossed the line 1 and whenever it reaches the line no 4 it shows the pop up "Acccess Denied". Why?

I could not understand it. Can you help me to solve this problem?

Post #13122
Posted 12/21/2007 7:53:28 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 2:02:58 PM
Posts: 644, Visits: 10,954
Hi Sachin.

Try changing your IF statament to:

If SecurityBasics.CurrentUser.IsAdministrator

Also, have a look at the help file under:

"Role-Based Security" / "Defining Security within the Application" / "Programatic Access" / "Security Basics Class" / "Built-In Accounts" -- here you find an explanation for built-in accounts you can set up in the Program.cs, if you need.

You may also have a look at the topic:

"Role-Based Security" / "Defining Security within the Application" / "Calling the Security Maintenance Dialog" for some more features about it.

Hope it helps.

Post #13123
Posted 12/21/2007 9:09:19 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
All StrataFrame forms have a field called ViewSecurityKey that is the security key that is checked when the form is shown to see if the user has permission to view the form.  We default the ViewSecurityKey of the SecurityDialog to "Security Editor".  This allows you to add a permission called "Security Editor" for the permission to get into the form.  If you don't want to use that key, then right before you call loForm.Show() (your line #4), you need to call loForm.ViewSecurityKey = "Secure".  This will set the security key for the form to the key you want to use rather than the default key for the form. 

This also means that you don't have to have the if test to check the security key before showing the form... simply set the security key to the proper key before showing the form and the Show() will check all of the security for you (and show the denied message when the user doesn't have permission to view it).


www.bungie.net
Post #13126
Posted 12/21/2007 9:18:27 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 2:02:58 PM
Posts: 644, Visits: 10,954
Hey Ben.

Never thought of the ViewSecurityKey for the SecurityDialog!   I thought the user needed admin priviledges to get into it.

Thanks for the tip.

Post #13128
Posted 12/23/2007 10:18:01 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 06/11/2008 7:29:38 AM
Posts: 6, Visits: 21
Hi Ben and Ivan,

Thanks for the key updation. I could not get in to the documentation. Currently me and my team is working to evaluate the StrataFrame for my client.

Thanks for your reply.

Post #13156
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:00pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.