Contents SAS/IntrNet 9.1: Application Dispatcher Previous Next

APPSRV_AUTHLIB



Determines whether the Application Server program is authorized to access a specified data source

Syntax
Arguments
Details
Examples


Syntax

RC = APPSRV_AUTHLIB( libname, memname, memtype, objname, objtype )

Arguments

All arguments to this function are optional.

libname
is a character string that is the SAS libref.

memname
is a character string that is the SAS member name.

memtype
is a character string that is the SAS member type.

objname
is a character string that is the SAS catalog entry name.

objtype
is a character string that is the SAS catalog entry type.

Details

The APPSRV_AUTHLIB function determines if the Application Server program is authorized to access the specified data source. The function returns a value of 1 if authorized and 0 if not authorized. Authorization is determined by the contents of the AUTHLIB data set. This data set contains rules for including and excluding various data sources. For more details on the AUTHLIB data set, see Controlling Access to Data Sources with the AUTHLIB Data Set. An asterisk (*) can be supplied for any of the arguments to mean "any." If an argument is omitted, then an asterisk is assumed.


Examples

For the examples in Table 2, refer to the contents of the SASHELP.AUTHLIB data set in Table 1. Entities are excluded by default, and all exclude rules supersede all include rules.

Table 1: Contents of SASHELP.AUTHLIB Data Set
Rule Libname Memname Memtype Objname Objtype
INCLUDE SASHELP * DATA * *
INCLUDE SASHELP * VIEW * *
INCLUDE SASHELP * MDDB * *
INCLUDE SAMPDAT * * * *
EXCLUDE SAMPDAT MYCAT CATALOG * *

Table 2: Examples
SAS Statements Results
rc=appsrv_authlib('SASHELP','RETAIL','DATA');
put rc=;

/*equivalent to
   rc=appsrv_authlib('SASHELP','RETAIL','DATA','*','*');
*/
rc=1
if (appsrv_authlib('SASHELP','CORE','CATALOG'))
   put 'You may proceed ...';
else put 'You are not authorized to access this
   SAS catalog';

/*equivalent to 
   if (appsrv_authlib('SASHELP','CORE','CATALOG','*','*'))
*/
You are not authorized to 
   access this SAS catalog.
/*Check to see if access to any SCL catalog 
   entries is allowed*/
/*NOTE: A true (1) response does not mean that 
   you can see ALL SCL entries, just some.*/
/*This returns true because some catalogs in 
   SAMPDAT are included*/

rc = appsrv_authlib('*','*','CATALOG','*','SCL');
put rc=; 
rc=1
/*Check to see if access to any of the entries 
   in the MYDATA.MYCAT catalog is allowed*/

rc = appsrv_authlib('SAMPDAT','MYCAT','CATALOG');
if (rc = 1) then put 'You can access at least some 
   of the entries';
else put 'Access to this entire catalog is 
   restricted';
Access to this entire catalog 
   is restricted.

Contents SAS/IntrNet 9.1: Application Dispatcher Previous Next