Access/Update Permission on Forms (OpenInsight Specific)
At 25 FEB 1999 07:30:05PM Duane ALDATA wrote:
I need to restrict access to the important source code (stored procedures, forms and form events) at our client sites. For legal reasons, we need to leave the source code at their sites, so we want to restrict the source code entities to only a couple of usernames. I've posted the code that I am using to do this below. The problem that I am having is that the security on the forms is not changing. It changes the security on the stored procedures and on the window events, just not on the form itself. Is this not OIWIN? Is there some other type of entity that I have to effect? I am doing all of this signed into OI as the application author. If you see any improvements that I can make to the posted code, by all means contact me.*Declare variables type_id=" type_id=STPROC" type_id=OIEVENT" type_id=OIWIN" application=@APPID max=1000 DIM buffer(max) MAT buffer=' counts=' *Once through the loop for each type of entity
FOR x=1 to 3
*Initialize variables more_info=1 current_type=type_id loop_count=0 total_count=0 *Get all of the keys
LOOP
*Retrieve the next block of 64k repository keys list=GET_REPOS_ENTITIES(application,current_type,"","","","",more_info) *If something is returned, add it to the buffer
IF (list) THEN
loop_count += 1
buffer(loop_count)=list
*Count the entities in this list count=COUNT(list,@FM)+1 counts=count *Add to total count
total_count += count
END
*Repeat if more then 64k of keys found WHILE LEN(more_info) REPEAT *Loop through all of the keys, one buffer page at a time
count_so_far=0
prev_percent=0
FOR y=1 TO loop_count
list=buffer(y)
count=counts
*Set the entity rights depending on lock/unlock FOR i=1 TO count reckey=list[i] count_so_far += 1 *Set the permission as specified
stat=REPOSITORY("SETACCESSPERMIT",reckey,allowed_users)
stat=REPOSITORY("SETUPDATEPERMIT",reckey,allowed_users)
NEXT i
NEXT y
NEXT x