Normal Topic Restrict database to allow viewing only (Read 1288 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Restrict database to allow viewing only
May 15th, 2013 at 4:23am
Print Post Print Post  
I am setting up a data base for use by numerous volunteers in a non-profit organization.  The purpose is to make "referrals" to inquiries for a service, type of business, etc. such as "house cleaners," "auto repair" etc. etc.

Is it possible to easily allow users to only view the database and not make any change to any field or any record within the database.

Only the "administrators" (3 or 4 people maximum) need to be "authorized" to be allowed to make changes.

  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Restrict database to allow viewing only
Reply #1 - May 15th, 2013 at 1:35pm
Print Post Print Post  
Hello Spencer,

There are two ways to do this. One is through the security manager where you set the elements as Read-Only for the "Users" group(or whatever you happen to name that group) and the other is through the use of programming. An example of this is below. This code would be used on Form Entry to make most elements read-only. The reason I say most is because if you have tabpages or command buttons you do not want them to be read-only. (Note: if your limited group is not named Users, you will need to modify this code)

Code
Select All
Var vUser as String
Var vLoop as Int
Var vCnt as Int
Var vElements as String
Var vName as String
Var vType as Int

vUser = @Group

If vUser = "Users" Then
{
	vElements = @StringArrayElementList()
	vLoop = 1
	vCnt = @CountStringArray(vElements)
	While vLoop <= vCnt
	{
		vName = @AccessStringArray(vElements, vLoop)
		SetThisElement(vName)
		vType = @ElementType(ThisElement)
		If ((vType >= 1000 And vType <= 1002) Or (vType >= 1004 And vType <= 1008)) Then
		{
			ReadOnly(ThisElement, 2)
		}
		UnSetThisElement()
		vLoop = vLoop + 1
	}
}

 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Restrict database to allow viewing only
Reply #2 - May 16th, 2013 at 1:45am
Print Post Print Post  
Ray -

Sounds a little overwhelming to me.  I've never done anything but create databases for essentially my own (unrestricted) use, so I'm not even aware of usergroups etc.

But your comments raise other issues for me because I do have quite a few tab pages, one or two are exclusively "command" buttons, another is a "mix" but the others are mostly for data that shouldn't be altered.

So, I'll have to take time to think this through more thoroughly and if I have to implement "something," I'll have to ask for additional help as I'm trying to implement it.

Thanks.

  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Restrict database to allow viewing only
Reply #3 - May 17th, 2013 at 5:52am
Print Post Print Post  
Ray the Reaper wrote on May 15th, 2013 at 1:35pm:
Hello Spencer,
     If ((vType >= 1000 And vType <= 1002) Or (vType >= 1004 And vType <= 1008)) Then


Ray,

Don't forget about the Text Editor type:
LE_TYPE_TEXT_EDITOR - 1024


BTW, what is LE_TYPE_GROUP - 1003 for? Why did you exclude it? I normally use the following to find all editable elements:
(vType > 999 and vType < 1009) or (vType = 1024)
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Restrict database to allow viewing only
Reply #4 - May 17th, 2013 at 12:42pm
Print Post Print Post  
Carl,

The element type "GROUP" is a container for subforms and not editable.

It looks like I should add an @IsEditable function to Sesame3.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Restrict database to allow viewing only
Reply #5 - May 17th, 2013 at 9:02pm
Print Post Print Post  
Carl Underwood wrote on May 17th, 2013 at 5:52am:
Ray,

Don't forget about the Text Editor type:
LE_TYPE_TEXT_EDITOR - 1024


Ah, You are right Carl. I did forget about that element type.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Restrict database to allow viewing only
Reply #6 - May 20th, 2013 at 2:30am
Print Post Print Post  
The Cow wrote on May 17th, 2013 at 12:42pm:
Carl,

The element type "GROUP" is a container for subforms and not editable.

It looks like I should add an @IsEditable function to Sesame3.

Something like @IsEditable would be a great addition!
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged