Iron Speed Technical Forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
SkyForum

Registered:
Posts: 71
Reply with quote  #1 
What is the best way to create a super admin that has access to everything. Currently each time I add a new property table (property as in an apartment complex) I have to assign the admin (me) permissions to it before I can interact with it. I am using role based security. 
__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,970
Reply with quote  #2 
Unfortunately, the "Super Admin" Role is nothing unless you assigned to a page. The only thing I wonder is,  why you always need to create a new property table, I would expect that all you need to do is to Add New Record, instead. 
__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,722
Reply with quote  #3 
Jimi is right! Security is assigned to controls and pages, not data.
__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
SkyForum

Registered:
Posts: 71
Reply with quote  #4 
I am sorry, I misspoke. I am in fact adding a new record, not creating a new table. It was late, I was tired.....
__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,970
Reply with quote  #5 
For greater flexibility of Role-Based Security applications, you need to add "whereClause" code on the ShowPages to group the records by Department/Company by applying the same as filters but, override for SA. 

Cheers,

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

SkyForum

Registered:
Posts: 71
Reply with quote  #6 
I already do that to control who sees what apartment complexes and it works well. (Property records) I am just looking for an example snippet for the SA override. Thanks for your time

__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,970
Reply with quote  #7 
Hi Bill,

Overriding the additional "WhereClause" filter is just blanking the string when the User has a SA role.  If you can post your existing "WhereClause" code, probably it will easier for us to rectify. 


Cheers,

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

SkyForum

Registered:
Posts: 71
Reply with quote  #8 
Here is the current: 

properties.idproperties = propertyroles.properties_idproperties AND
propertyroles.users_idusers = UserId()

I'm not sure what you mean when you say "blanking the string when the user has a SA role."  

When I originally created this app I did it just for my company so all I needed was an admin role. It didn't really bother me that I had to add access to each record as they were created. 

Now as it turns out, another company has taken great interest in my little project so I now need to create an SA role so I can access everything that gets added as well as a Company role so I can one company from being able to access another companies records.  

I know it's probably very simple but in the interest of time I appreciate any help you can give me in understanding how to apply it. 

__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,970
Reply with quote  #9 
Static Page WhereClause will never accomplish your desire. You need to write codes.

The approach is very simple:
1) You may let the Admin to be used Property Owner as Local Admin to manage his own users
2) Get SA as yours to manage all properties
3) Ordinary users can just access their own records.

Then for Admin or Local Admin (Property Owner), filter only by Property.
For Ordinary Users, filter by UserId. Do not apply any filter to SA. That's it.

"In the Philippines, we say, only the carabao gets old...."

   

 

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

SkyForum

Registered:
Posts: 71
Reply with quote  #10 
Yup. Sounds simple. I do have a question however. (and I apologize if this is a stupid question because I am not a coder by any stretch of the imagination). The SA will also have a userid right? How do I ... oh wait.... I just spotted something in your most recent response.

"3) Ordinary users can just access their own records." ... My users do not have any of their own records except their account information and maybe some internal messages. Everything else is assigned. In other words, they join the site, create a membership and then we build their records (adding properties, violations, etc) we then use the where clause I created above to allow them to access the required records. In other words, they don't create the records so they are not the owners of the records. 

That is my issue. I want to add a string (Where clause, whatever) that allows the SA account to access everything without having to assign each record to them. Even when I create a new record as an admin I have to go into my user_has_roles table and assign myself (admin) to each record or I can't access them within the app.

Is it possible to just add something like this? (and knowing my own lack of skill I am sure it's formatted wrong)

properties.idproperties = propertyroles.properties_idproperties AND
propertyroles.users_idusers = UserId() 

OR

properties.idproperties = propertyroles.properties_idproperties AND
propertyroles.roles_idroles = rolesid(14<----the SA role id

I know this is wrong. Even I can see the fault in it. 

I have thick skin. Just tell me when I'm starting to annoy you and I'l go away.... [biggrin] (hint, my exploits would make great fodder at a party with your peers, lol)

BTW, Don't worry about the multiple company issue. I have already worked that out. Pretty simple to just add another role and adjust my DB relationships accordingly.

__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,722
Reply with quote  #11 
You need additional filters on your whereclause, in code.  You test for whether Super-Admin is logged in or not.  If SA is logged in, no filters, otherwise filter as required. I can help you with this....

Cheers,

Miles

__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
lyonsden999

Registered:
Posts: 17
Reply with quote  #12 

The way I do it is I create an additional column in my user table. Then I populate it with the property name(might work with PropertyID, needs to be a text type field). Then in the Add New User page I create a dropdown for the property name field. In the static list for the dropdown you can add in the Display Text "ALL" and in the Value you put "%" (no quotes).

Then your query for the display of properties you would use a Where Clause of

Where: tbl_Properties.PropertyName LIKE GetColumnValue("tbl_Users", UserName(), "PropertyName")

In the permissions add all user levels to the page. When the Super Admin is logged in the PropertyName for that user is % so the property query returns all records. When it is a Prop Manager logged in it will return just the property that that manager manages.

I think if you used the propertyID instead of the PropertyName and made it a numerical or int field the LIKE part of the query would not work.

Hope that makes sense.


__________________
lyonsden999
SkyForum

Registered:
Posts: 71
Reply with quote  #13 
Quote:
Originally Posted by miles
You need additional filters on your whereclause, in code.  You test for whether Super-Admin is logged in or not.  If SA is logged in, no filters, otherwise filter as required. I can help you with this....

Cheers,

Miles


Would very much appreciate your help. What do you need from me?

__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,722
Reply with quote  #14 
send me an email: miles@milestone.ca
__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
SkyForum

Registered:
Posts: 71
Reply with quote  #15 
I haven't forgot about this. I had to take care of other things. I promise I'll be getting back to it.... 
__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement