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

Simple example of limiting access to a portal


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

Recommended Posts

Posted

Hi,

I have been requested to lock down a portal in a layout so that only a small group of people can modify the fields in the portal, all other users should have read only access. I would like to know the best way to do this.

Ideally, I do not want additional layouts just for certain groups, and neither do I want a password input box unless completely necessary.

Any Ideas?

Thanks,

Joseppic.

Posted

Hello Joseppic,

You can do this via field validation; a rough -hardcoded- example would have the following calculation in the field validation:

Case ((Status(CurrentUser) = "User1") or (Status(CurrentUser) = "User2"), 1 )

Where User1 and User2 are the names of users that ARE allowed to change the fields in the portal. If you do it this way, Filemaker will use the username specified for the machine, or in Filemaker's prefs.

Hope this helps,

Ernst.

Posted

You could also create two versions of the same layout. One where the fields can be edited, and one where they can't. Then, set the access privileges for these layouts accordingly, and possibly have a navigation script to go to the appropriate layout according to the access privileges.

Posted

I've been experimenting trying to do the same thing. I went with creating two layouts, but am having trouble creating a script that will take the user to the correct layout based on their logon password. Does anyone have an example of a script that will do this?

Posted

Problem with this, is that there is no Status(CurrentPassword) function.

A way around this is to assign passwords to different groups and use Status(CurrentGroup) in stead.

Script will be something like:

If Status(CurrentGroup) = Group One

goto layout (Group One layout)

else

If Status(CurrentGroup) = Group Two

goto layout (Group Two layout)

End if

End if

Hope this helps,

Ernst.

Posted

You would think that would work, but for some reason it's not. I always go to the "Group 1" layout no matter how I'm logged in. Is there something missing in the script?

Posted

You have to be careful how you check the group. Status(CurrentGroups) will return a list of all the groups (separated by a linebreak) to which the current user belongs. The full access password automatically belongs to all groups. So, you need to use either the position() or patterncount() function to find a particular group.

Use:

PatternCount(Status(CurrentGroup),"developer")>0

instead of:

Status(CurrentGroup)="developer"

Posted

This also explains why it is plural, Status(CurrentGroup[color:"red"]s)

Thanks Bob!

Posted

You're welcome, but remember to change it like Bob suggested in his post!

Regards,

Ernst.

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