home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
clipper
/
snip0693.zip
/
CANWRITE.PRG
< prev
next >
Wrap
Text File
|
1992-09-05
|
2KB
|
68 lines
════════════════════════════════════════════════════════════════════════════════
Area: CLIPPER
Date: 13 Aug 92 21:32:40 Public
From: Phil Barnett
To: Scott Feibelman
Subject: CLIPPER/NOVELL
────────────────────────────────────────────────────────────────────────────────
In a message of <Aug 11 15:32>, Scott Feibelman (1:387/822) writes:
> With or without Novell running, Clipper does not like a read-only
>attribute on its databases. With read-only set, Clipper refuses to open
>any files...It just blows out to DOS. My Novell problem comes from
>trying to limit certain users to read-only priviledges.
>
> Why? My best answer would be to assume that Clipper assumes that if
>you're opening a file then you are probably going to write to that file.
>If this is the case, wattajip! How do you set read-only users?
You don't leave it up to dos, you log users into your program and control
writeback access yourself. Not difficult at all.
Build a userlist with access levels
Use Netlib or Novlib or one of many others to find out the login name.
(or have the user log into the program on entry)
userid := whatever you decide and however you get it (in top module only)
access(userid)
later, (anywhere in the code) surround all rights with something like this...
if write()
replace xxx with mxxx
endif
write() is a function in the access rights .prg that access the static variable
the access function sets. default it to .f.
something like:
------------clip here--------------
static can_write := .f.
function access(userid)
select userlist
seek( userid )
if found()
can_write := field->rights
else
can_write := .f.
endif
return nil
function write()
return can_write
------------- end of functions -------------
Good luck!
--- msged 2.07
* Origin: The Heap - Apopka,FL (1:363/18.2)