Normal Topic Security Permissions (Read 2461 times)
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Security Permissions
Nov 26th, 2004 at 11:32pm
Print Post Print Post  
This does not seem right, but maybe its just my learning curve on security?

I was trying to provide a user with Read Only rights.  User would be able to browse all records, but make no changes.
Did this in Q&A by setting all permissions to NO.

Can't seem to make that happen in Sesame. 
Using 1.0.5 Beta version.
=====================

Current settings for this user in Sesame:

Group = Guests, User Level = DataEntry

User Name = guest, User Group = Guests, User Level=Data Entry.

Select a Layout = Form1
Select an Element = Form1

Group Name Permission for Layout/Elements:
Group = Guests
Allow Read = Checked
Allow Write = No Check
Allow Execute = No Check
============================
User "guest" logs in, goes to form to Add Records, and is successful (BAD).
Guest can also modify existing records (BAD). 
Guest cannot delete records.....that is GOOD!





  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Security Permissions
Reply #1 - Nov 27th, 2004 at 3:57pm
Print Post Print Post  
Bob,

Permissions do not cascade that way. To make every element on a form read-only, set the permission for each element.

Setting the form itself to read-only only affects the form, not the elements on the form.

BTW, you may want to do this in SBasic code instead, in order to take advantage of the new Read-only (Not Greyed Out) setting.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Security Permissions
Reply #2 - Nov 27th, 2004 at 8:41pm
Print Post Print Post  
Quote:
BTW, you may want to do this in SBasic code instead, in order to take advantage of the new Read-only (Not Greyed Out) setting.


So you saying:
1.  Read Only on the form does what?  Prevents Group members from adding/modifying/deleting elements on the form or the form's properties?

2.  To make a form that cannot be written to, I should make a Form Entry loop that makes all elements ReadOnly if UserID = guest or some other condition(s).
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Security Permissions
Reply #3 - Nov 27th, 2004 at 9:57pm
Print Post Print Post  
Quote:
So you saying:
1.  Read Only on the form does what?  Prevents Group members from adding/modifying/deleting elements on the form or the form's properties?


At the moment, it prevents a user from deleting records. This flag is likely to be expanded as the security model expands to include things like Design rights and/or Spec editing capabilities.

Quote:
2.  To make a form that cannot be written to, I should make a Form Entry loop that makes all elements ReadOnly if UserID = guest or some other condition(s).


If you don't want the elements to grey out, that would be the way to go.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Security Permissions
Reply #4 - Nov 28th, 2004 at 4:30am
Print Post Print Post  
Could use some help to find the error in this code. 

Code is to make all elements on the form to become Read Only.  I have added an AskUser to help test by turning on/off.  Final version will use an IF condition for User/Group.  Also added Message Box to help troubleshoot.  MsgBox does seem to indicate that program is executing when it should, and that all of the elements are being identified correctly.

Program is in section to execute On Form Entry.  It is generic and should be able to be plugged into any form.
I am using Version 1.0.5 Beta.

Hmmm....just got an idea to include @ReadOnly and MsgBox before the line to change to ReadOnly......stay tuned.........
OK, I just added a few more lines to check ReadOnly status and it shows that ReadOnly condition is not changing.

Quote:
// To make all elements to Read Only
var vStr as string
var vName as string
var vLoop as int
var vCnt as int


IF @ASKUSER("Do you want this to be READ ONLY?","","")
{
// Initialize the list to all the LEs
vStr = @StringArrayElementList()

// Count the total set of all LEs
vCnt = @CountStringArray(vStr)

FOR vLoop = 1 TO vCnt
     // Get the name
     vName = @AccessStringArray(vStr, vLoop)
     //Get Current Read Only Status
     @MSGBOX("Current ReadOnly value for " + vName,"is: " + @STR(@ReadOnly(vName)),"")
     // Set this element to Read Only
     ReadOnly(vName,1)
     @MsgBox("Total of " + vCnt + "elements","Element " + vLoop + "is named: " + vName,"ReadOnly status is: " + @STR(@ReadOnly(vName)))
NEXT
}
//=========================================

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
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: Security Permissions
Reply #5 - Nov 29th, 2004 at 4:07pm
Print Post Print Post  
Hello Bob,

After taking a quick look at your code I can see that you forgot to make vname an Element Reference.

Code
Select All
// To make all elements to Read Only
var vStr as string
var vName as string
var vLoop as int
var vCnt as int


IF @ASKUSER("Do you want this to be READ ONLY?","","")
{
// Initialize the list to all the LEs
vStr = @StringArrayElementList()

// Count the total set of all LEs
vCnt = @CountStringArray(vStr)

FOR vLoop = 1 TO vCnt
 // Get the name
 vName = @AccessStringArray(vStr, vLoop)
  // Set the ThisElement Pointer
  SetThisElement(vName)
  // Set ThisElement to ReadOnly
  ReadOnly(ThisElement,1)
 NEXT
}
UnSetThisElement()
//=========================================
 



-Ray
  

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


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Security Permissions
Reply #6 - Nov 29th, 2004 at 8:58pm
Print Post Print Post  
Thanks Ray....

Looks like that did it.  Only had to make one edit to move the Unset command above the closing brace for the ASK function. (Will be removed anyway, changed to IF-@Group check):
Quote:
FOR vLoop = 1 TO vCnt
// Get the name
vName = @AccessStringArray(vStr, vLoop)
  // Set the ThisElement Pointer
  SetThisElement(vName) 
  // Set ThisElement to ReadOnly
  ReadOnly(ThisElement,1)
NEXT 
UnSetThisElement()
}
//=========================================


One unforseen result is that I cannot tab across the different Tabs.  Surprised that is the case, I had expected that even though ReadOnly, I should be able to open each one for review of ReadOnly elements on those Tabbed Pages. 

So I will now have to modify to Remove ReadOnly from the TabPage names.  Seems to me there must be a way to check for Element Type, and not make ReadOnly if a Tab Element.  Need to do some more homework.

Thanks again for the help re SetElement().  (First time to use these commands)  Now have better understanding.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
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: Security Permissions
Reply #7 - Nov 29th, 2004 at 9:57pm
Print Post Print Post  
Hello Bob,

You would want to use @ElementType() which is documented on page 27 of the 1.0.4 documentation supplement.

You are welcome,
-Ray
  

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