September 12, 200718 yr I have a file that requires 3 levels of access. Manager (see everything) State manager (See only records that are in their state) User (see only record that belong to that user) Using "define accoutn and privs" I've managed to get Manager and user to work with "custom record privileges". Setting it to limited and using AccountName = Get ( AccountName ) to set the user level and show only record that belong to that account name. Manager has view everything so that was no problem This was working fine until they requested State managers will need to see all records that belong to their state.. My thinking on this was along these line... If ( Get ( AccountName ) ; Users profiles::State ; 1 ) The thinking behnd this is if the account name (ie VIC) matches the State (IE VIC) then show record, if not then don't. This isnt working.. am i heading in the right direction, or is there a better way? Hope this makes sense. Cheers Al
September 12, 200718 yr If( Get(AccountName) = AccountName and Table::State = globalTable::userState ; 1 ) Essentially, add a globals table, for your startup script, go to the users profiles table, find the user's account record, and set a global field calld userState to the value of that user's state. Then you have constant access to it. If you don't know how to add a global field, simply create a text field, go to storage options and click use global storage.
September 12, 200718 yr Author Hi Genx... Thanks for that, I'll give that a go, and see what happens. Just a thought... If there is a global State in there, wouldnt that mean we couldnt have other states (ie NSW, ACT and so on) i think im missing your point sorry. Cheers Al
September 12, 200718 yr Huh? No, the point of the global state field is specifically to temporarily store the value of the person that is logged in. So if you had 10 people logged in, the global would be storing a different state for each person (whatever state they are responsible for supervising). Myeh, take a look at this, and see if it helps: http://faq.filemakermagazine.com/index.php/Global_fields
September 13, 200718 yr Author Sorry Genx.. im completly missing what your saying.. im sure that its very simple once you get it... Could you explain again, in complete dummies terms or do you know of an example that i could pull apart and have a look at? Just to set the scene, im a Graphic Designer that fell into FMP, rather than a programmer. IE im a dummy left brainer, not a logical right brainer :
September 13, 200718 yr I'm a... No Brainer, but i think you may have your hemisphere's backwards lol : There are 4 accounts: User, Pass: NSW, NSW VIC, VIC QLD, QLD Admin, Note that the actual account names have nothing to do with the way this works - they have just been named as the states to make the demo easier. HTH multiLevelSecurity.zip
Create an account or sign in to comment