A simple example would be fine ... or a hint where to look in which fine
manual :-)
thanx - Ulli
\ Ulli 'Framstag' Horlacher \ psi%0262450502601::rzmain::orakel \
\ Student consultant VAX/VMS and networks \ ora...@dulruu51.bitnet \
\ Rechenzentrum Universitaet Ulm Germany \ ora...@rz.uni-ulm.de \
\ "With mainframes you just can do nonsense, with PCs not even that." \
Since this is not the first time someone has asked, I will post a FORTRAN
function that performs this operation.
The following is a logical function that will return true if a user
possesses a specific rights identifier.
As far as I know these item codes are not in the manual...
Thanks,
Bill
-------------------------------------CUT HERE-----------------------------------
* This function returns true if a person has the identifier passed in
* set in his/her process rightslist.
logical *4 function id_set (ident)
implicit none
* Parameter lsize set to 512 will allow for the first 256 (approximately)
* identifiers of a process. Should a user have more than 256 identifiers
* set, then this number should be increased.
parameter lsize = 512
character *(*) ident
character *31 name
integer *4 status,rights_size,rights_len,sys$getjpi,i,context
integer *4 rights(lsize),name_dsc(2)/31,0/,sys$idtoasc,length
structure /item_list_3/
union
map
integer *2 buf_len,it_code
integer *4 buf_adr,ret_len
end map
map
integer *4 end,%fill
end map
end union
end structure
record /item_list_3/ list(2)
list(1).buf_len = 16
* Parameter JPI$_RIGHTS_SIZE (value 817) is not currently in FORSYSDEF.TLB.
list(1).it_code = 817
list(1).buf_adr = %loc(rights_size)
list(1).ret_len = 0
list(2).end = 0
status = sys$getjpi(,,,list,,,)
if (.not.status) call lib$signal(%val(status))
list(1).buf_len = rights_size
* Parameter JPI$_PROCESS_RIGHTS (value 814) is not currently in FORSYSDEF.TLB.
list(1).it_code = 814
list(1).buf_adr = %loc(rights)
list(1).ret_len = %loc(rights_len)
list(2).end = 0
status = sys$getjpi(,,,list,,,)
if (.not.status) call lib$signal(%val(status))
name_dsc(2) = %loc(name)
id_set = .false.
context = 0
do i = 1,lsize
status = sys$idtoasc(%val(rights(i)),length,name_dsc,,,context)
if (name.eq.ident) id_set = .true.
enddo
end
-----------------------------------END OF CUT-----------------------------------