Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Check permissions when going to a layout 2??


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

Recommended Posts

Posted

Hi

Quote from Steven:

"Take a look at the Get (LayoutAccess) function. It does exactly what you need.

Returns:

0 if the custom layout privileges of an account's privilege set allow no access to Records via this layout.

1 if the custom layout privileges of an account's privilege set allow view only access to Records via this layout.

2 if the custom layout privileges of an account's privilege set allow modifiable access to Records via this layout.

Have your script test for this and then branch accordingly."

SOrry this is only my third week playing with filemaker, i wish to input this function too. After playing with it and check from f1 help i still got no idea how am i going to write this script. Help really needed..

Thanks a lot..

Kelvin

Posted

The script would look something like this

GoTo Layout [someLayout]

if get(layoutAccess) = 0

show custom dialog [you can't access this layout]

goto layout [original layout]

else

... the rest of the logic here

end if

Posted

Hi Wim Decorte

Really thanks for your help.

My manager expects this to be on IWP, and iwp nv supports show custom dialog, anything else i can replace it?

get(layoutAccess) <-- How does this works?

And how should i set my password and privileges? At first what i did is disable my script(AdminCheck). Or i should disable access to that layout instead siable the script?

Posted

You don't need the dialog, instead of that step, you can take them to a blank layout with the message on it and a button to return them to where they were.

get(layoutAccess) looks at the privilege set of the current user. In the privilege set (under "accounts & privileges") you can set what users have access to what layouts, fields, records,...

Posted

Hi Wim Decorte

I got 1 doubt..

I tried what u states it work fine, but when i remove the first line of code it got error. Why? isn't it redundant? since in my else statement it will bring me to 'somelayout'.

"GoTo Layout [someLayout]"

if get(layoutAccess) = 0

goto layout [original layout]

else

goto layout [some layout]

end if

able to explain to me as im learning still..

Thanks a lot..

Kelvin

Posted

I don't quite follow you.

The script as you write it says this:

goto layout "SomeLayout"

if the user has no access to layout "someLayout" then

goto layout [where you came from]

else

goto layout [someLayout]

everything starting with the Else is redundant because if the user has access privileges to SomeLayout he will be there by virtue of the very first script step.

If you remove the first step (goto layout "someLayout") then all you're doing is testing if the user has access privileges to the *current* layout he is on. And if he's on it, of course he has access to it :)

Posted

Hi Wilm Decorte, I think i get what you mean..

GoTo Layout [someLayout]

if get(layoutAccess) = 0

goto layout [original layout]

end if

I can actually also use this right.. All are like sort of the same right? But which way of writing it should i pratice..?

Thanks..

Kelvin =)

  • 5 months later...
Posted

I'm going nuts trying to figure out why this technique isn't working for me! I have set layout access to the Admin layout for priv set "User" to no access. My nav script is:

go to layout "Admin"

if get (layoutaccess) = 0

show msg "Msg Text"

go to layout "Main"

else

set window title

end if

What happens, when logged in as a user with priv set "user" whose layout access is 0, they click on button to go to Admin, get a grey screen and are trapped! Close system to exit. No message. It's not doing the next step of the script--and the debugger, of course, doesn't work for non-[full access] logins. Am I missing something simple?

This topic is 6784 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.