Hola Jaime

        Quizas te sirva este programita que te envio adjunto y que creo es lo que
necesitas

        Salu2

        Fernando Martinez



-----Mensaje original-----
De: [EMAIL PROTECTED]
[mailto:forum.help400-request@;combios.es]En nombre de Jaime Villa Torres
Enviado el: s�bado, 09 de noviembre de 2002 2:23
Para: [EMAIL PROTECTED]
Asunto: Suplantar un Usuario.


Se�ores, es posible que tener un usuario, sin ninguna autorizaci�n especial,
que ejecute una opci�n de un men�, pero lo que se requiere es que el trabajo
salga con otro perfil de usuario y este perfil si tiene autorizaciones
especiales sobre los objetos que ejecuta el programa de la opci�n. No se
quiere realizar CL con OWNR, ya que hemos tenido problemas con
autorizaciones delegadas en los objetos.
Gracias por su tiempo
Saludos



_____________________________________________________
Forum.HELP400 es un servicio m�s de NEWS/400.
� Publicaciones Help400, S.L. - Todos los derechos reservados
http://www.help400.es
_____________________________________________________

Para darte de baja, env�a el mensaje resultante de pulsar
mailto:forum.help400-request@;combios.es?body=LEAVE
/*********************************************************************/
/*                                                                   */
/* Create as user with *ALLOBJ and *SECADM                           */
/* CRTCLPGM PGM(lib/SWAP) USRPRF(*OWNER) AUT(*EXCLUDE)               */
/*                                                                   */
/*                                                                   */
/* PURPOSE: SWAP -- This program will swap the user profile of       */
/* a job but prevents swap to a user profile                         */
/* the with *ALLOBJ *SERVICE *SECADM OR *SPLCTL                      */
/* special authority                                                 */
/*********************************************************************/
RESETPWD: PGM (&USERID)

            DCL &USERID *CHAR 10

            /*********************************************************/
            /* Variables for API to retrieve user profile attributes */
            /*********************************************************/

            DCL &RTNDTA *CHAR 83

            /***********************************************/
            /* API work area USRI0200 data returned        */
            /***********************************************/
            /*   Type      Field                           */
            /* 1 BINARY(4) Bytes returned                  */
            /* 5 BINARY(4) Bytes available                 */
            /* 9 CHAR(10)  User profile name               */
            /* 19 CHAR(10) User class name                 */
            /* 29 CHAR(15) Special authority               */
            /* 29 CHAR(1 )   ALLOBJ                        */
            /* 30 CHAR(1 )   SECADM                        */
            /* 31 CHAR(1 )   JOBCTL                        */
            /* 32 CHAR(1 )   SPLCTL                        */
            /* 33 CHAR(1 )   SAVSYS                        */
            /* 34 CHAR(1 )   SERVICE                       */
            /* 35 CHAR(1 )   AUDIT                         */
            /* 36 CHAR(1 )   IOSYSCFG                      */
            /* 38 CHAR(7 ) future expansion                */
            /* 44 CHAR(10) Group profile name              */
            /* 54 CHAR(10) Owner                           */
            /* 64 CHAR(10) Group authority name            */
            /* 74 CHAR(10) Limit capabilities              */
            /***********************************************/

            DCL &OUTVARD *DEC (5 0) VALUE(83)
            DCL &OUTLEN *CHAR 4
            DCL &FMT *CHAR 8 VALUE(USRI0200)
            DCL &ERRCDE *CHAR 80
            DCL &ERRLEND *DEC (5 0) VALUE(80)
            DCL &HANDLE *CHAR 12

            /******************************************************/
            /* Retrieve the special authority of the user profile */
            /* Do not allow reset if user has special authority   */
            /* *ALLOBJ *SECADM *SPLCTL or *SERVICE                */
            /******************************************************/

            CHGVAR VAR(%BIN(&OUTLEN)) VALUE(&OUTVARD)
            CHGVAR VAR(%BIN(&ERRCDE 1 4)) VALUE(&ERRLEND)

            CALL QSYRUSRI +
            (&RTNDTA &OUTLEN &FMT &USERID &ERRCDE)

            IF ( (%SST(&RTNDTA 29 1 )='Y') *OR /*check *ALLOBJ*/ +
                 (%SST(&RTNDTA 30 1 )='Y') *OR /*check *SECADM*/ +
                 (%SST(&RTNDTA 32 1 )='Y') *OR /*check *SPLCTL*/ +
                 (%SST(&RTNDTA 34 1 )='Y')) DO /*check *SERVICE */
               SNDPGMMSG MSGID(CPF9801) MSGTYPE(*ESCAPE) +
               MSGDTA('Swap of this user profile not allowed.')
            ENDDO
/************************************************************/
/* Swap user profile                                        */
/************************************************************/

/*            CALL QSYGETPH (&USER '*NOPWD' &HANDLE)        */
            CALL QSYGETPH (&USERID '*NOPWD' &HANDLE)
            CALL QWTSETP  ( &HANDLE)
            CALL QSYRLSPH ( &HANDLE)

ENDPGM

Responder a