Updating Entitity Access rights from within a Runtime (OpenInsight Specific)
At 24 JUN 1998 12:31:05PM Steve C. wrote:
Using OI3.6.1
Can I access the "Entity Properties" window and change the
"Access Permit" from within a Runtime system. If so, how
would I call up the "Entity Properties" window.
.
Can I accomplish the same as above by editing the SYSREPOS
record of a form in the system editor, again within the Runtime,
and change and save the 2nd field which shows the access rights.
.
Thanks..
Steve C.
At 27 JUN 1998 07:56PM Aaron Kaplan wrote:
You could just manually edit or programatically update SYSREPOS. However, I'm pretty sure there is a program called SET_ACCESS_PERMIT or something like that that might do it. Sorry, I don't have OI at home otherwise I'd look it up.
At 29 JUN 1998 08:44AM Steve C. wrote:
Aaron,
I've looked in SYSPROCS and SYSOBJ and can't find anything like
SET_ACCESS_PERMIT. If you're back at work can you check on this again.
Thanks much….
Steve C.
At 29 JUN 1998 10:18AM Cameron Revelation wrote:
Steve,
In an old thread I posted the list of all Repository methods. Two of these methods that you want to look at are:
GETACCESSPERMIT
SETACCESSPERMIT
The syntax, based on the method declarations, is:
List=Repository("GETACCESSPERMIT", EntID)
Repository("SETACCESSPERMIT", EntID, List)
In both cases, List is an @fm delimited list of names, similar to what you see in the SYSREPOS table (except in SYSREPOS the data is delimited by @vm).
To add a name to the list, I would suggest something like:
<code> Set_Status(FALSE$) List=Repository("GETACCESSPERMIT", EntID) if Get_Status(Err) then gosub ErrHandler end else locate Name in List using @fm setting Pos else List=Name Repository("SETACCESSPERMIT", EntID, List) if Get_Status(Err) then gosub ErrHandler end end end</code>
BTW If you look at REPOSITORY_EQUATES, it defines PUBLIC$ which is the default access. Your security system may want to remove it by default for secured items, but I suggest testing the effect of an entity without any security set. Also, security setting is only allowed by the author of the app or the author of the entity, so your security-setting user should probably be the same as the application author.
I have not spent much time experimenting with entity level security, so I don't have any good tips on things to watch out for our what would make the security system really neat, but this should get you started. I would appreciate knowing how your system turns out and if you find out any gotcha's or neat tips.
Thanks,
Cameron Purdy
Revelation Software
At 29 JUN 1998 09:24PM Jim Wheeler wrote:
Here's a piece of code that gets all OIWIN entities and changes both access and update permissions, hope it helps ya.
DECLARE FUNCTION GET_REPOS_ENTITIES,COUNT,SEND_EVENT,UTILITY
app_id =@APPID
class_id ="
more_info =1
tabl =SYSREPOS"
OPEN tabl TO sysrepo ELSE debug
*Get window names and change rights.
type_id =OIWIN"
LOOP
oiwin_list=GET_REPOS_ENTITIES(app_id,type_id,class_id,"","","",more_info)
IF LEN(oiwin_list) THENoiwin_cnt=COUNT(oiwin_list,@FM)+1ENDWHILE LEN(more_info)
REPEAT
*Set rights. FOR i=1 TO oiwin_cnt rec_key = oiwin_list[i] READ sysrec FROM sysrepo, rec_key ELSE debug access_rights=BRYAN":@VM:"JIM":@VM:"DUANE":@VM:"MIKE" update_rights=BRYAN":@VM:"JIM":@VM:"DUANE":@VM:"MIKE" sysrec=access_rights sysrec=update_rights WRITE sysrec TO sysrepo, rec_key ELSE debug NEXT i
At 01 JUL 1998 04:16PM Aaron Kaplan wrote:
Well, modified permissions on an entity and the engine log gave me the following:
RUN REPOSITORY 'SET', 'HRIS*OIWIN**ABOUT', 'SYSPROG