Jump to content

Allowed by field value


rob

This topic is 3492 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I was just reading here http://fmforums.com/forum/topic/28989-best-calculation-for-custom-record-privileges/

 

Steven says be careful about people being able to change this data.  Here is my situation please if someone could help

 

 

I have a table called Users with a field called Type.  This means they can only change records which also have this Type field in them.  But when I go to set up their privilege set, the calculation box is throwing me.

 

If(User::Type = Sales Orders::Type)

 

but how will the calculation know which user I am referencing?  All I can think to do is put the person's type into a global variable when they log in and then calculation would be If($$userType = Sales Orders::Type)

 

Is this right or does that open up problems?  If $$userType is global, is it insecure?  Or is there other way of doing what I need.  Thank you.


Oh and I meant to say that the users table is only allowed to even see by our owner and me of course so nobody could change the type.

Link to comment
Share on other sites

There are two possible solutions here:

 

1. Define a relationship between the two tables, using an unstored calculation filed in the Sales Orders table =

Get (AccountName)  

to match a stored AccountName field in the Users table. This way (and only this way) will the calculation know which record in Users to look into.

 

Of course, you will need to repeat this for every table where you want to consult the user's record, so it might be more convenient to:

 

 

2. Populate a global field with the current user's type. Note I said a global field, not a global variable. And you must be "careful about people being able to change this data" - IOW, define this field in the Users table to which no one has access.

Link to comment
Share on other sites

Can I set a global field in another file?  It looks like it works but that might just be because I am the only one I can see anyway so my view of the universe is limited and I am not network or anything.

Link to comment
Share on other sites

Well of course it works.  I was not thinking.  I get confused when in the data viewer.  Does the WATCH only ever be something I see?  For example, if I am watching fields in a file and I give that file to someone else and they have advanced and open the data viewer, do they see what I have in my WATCH list?  

Link to comment
Share on other sites

This topic is 3492 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.