Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DBTSACC

DBTSACC.m

Go to the documentation of this file.
  1. DBTSACC ;remote procedure call to send back the security type of a user [ 02/05/1999 10:55 AM ]
  1. ;logging in to use the diabetes register on the client
  1. ;the call will send me the DUZ of the user
  1. ;this will check the security keys of the user and send back
  1. ;the type of access if any for the user
  1. ;
  1. ; codes sending back to the client
  1. ; -1 = error probably no keys est. on the RISC box yet
  1. ; 0 = top level of security (DBTSEDIT key) is held by user
  1. ; 1 = (DBTSADD key) user hold add privledges
  1. ; 2 = (DBTSREAD key) user holds read only key
  1. ; 3 = unknown no privledges to access the diabetes register
  1. ;
  1. ;
  1. START(RET,DUZ) ;
  1. K RET
  1. S ^DBTSTMP("TEST")=DUZ
  1. I '$D(DUZ) S RET(1)="-1" Q
  1. I DUZ'?.N S RET(1)="-1" Q
  1. D KEYS I $D(RET(1)),(RET(1)="-1") Q
  1. I '$D(DBTS) S RET(1)="-1" Q
  1. F I=0,1,2 S KEY=DBTS(I) I KEY'="",$D(^VA(200,DUZ,51,KEY)) S RET(1)=I Q
  1. ;I RET(1)="" S RET(1)="3" Q
  1. I '$D(RET) S RET(1)="3" Q
  1. Q
  1. ;
  1. KEYS ;
  1. I '$D(^DIC(19.1,"B","DBTSEDIT")),'$D(^DIC(19.1,"B","DBTSADD")),'$D(^DIC(19.1,"B","DBTSREAD")) S RET(1)="-1" Q
  1. F DBTSKEY="DBTSEDIT","DBTSADD","DBTSREAD" D
  1. .S DBTSKDFN=$O(^DIC(19.1,"B",DBTSKEY,0))
  1. .I DBTSKEY="DBTSEDIT" S DBTS(0)=DBTSKDFN
  1. .I DBTSKEY="DBTSADD" S DBTS(1)=DBTSKDFN
  1. .I DBTSKEY="DBTSREAD" S DBTS(2)=DBTSKDFN
  1. Q