Normal Topic Allowing read only access for a few users. (Read 544 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Allowing read only access for a few users.
Aug 31st, 2017 at 2:32pm
Print Post Print Post  
I have about 20 user groups in my application.  To date, I've allowed groups to read only access by identifying each group in an IF statement listing each group:

If @Group="111" or @Group ="444" etc.

This gets cumbersome when I'm trying to allow only 2 or 3 groups complete access.  Is there some way to program something like "If not one of these three groups, then do this:"

NHUser
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Allowing read only access for a few users.
Reply #1 - Aug 31st, 2017 at 3:15pm
Print Post Print Post  
Hi Paul,

You can use @FindStringArray() in code something like
Code
Select All
Var vGroup as String
Var vReadOnlyGroup as String
Var vAdminGroup as String

vGroup = @Group
vReadOnlyGroup = "AAA;BBB:DDD"
vAdminGroup = "CCC;EEE"

If @FindStringArray(vReadOnlyGroup, vGroup) > 0 Then
{
	Writeln("They are in a Read Only Group so make things Read Only!")
}
If @FindStringArray(vAdminGroup, vGroup) = -1 Then
{
	Writeln("They are not in an Admin Group so do something non admin!")
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged