Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

PswAdmin

PswAdmin(cUsuario,cSenha) -> nRet

Checks legacy administrator membership

PswAdminAdvPL
01 · OVERVIEW

Overview

The historical manual documents 0 for administrators, 1 for nonadministrators and 2 for an invalid password. Do not interpret the numeric result as a Boolean. This is a function despite its legacy queue classification as a class. The uninvoked block compares with zero and receives credentials from its caller. This old reference does not establish MFA, SSO, token support or current release authentication behavior. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

PswAdmin(cUsuario,cSenha) -> nRet

Parameters

cUsuario
CharacterRequired

User supplied by caller.

cSenha
CharacterRequired

Runtime password; never log it.

Return value

Numeric: 0, 1 or 2 in the historical reference.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed600()
    // Uninvoked block: requires authorized context and credentials.
    Local bRead := {|cUser,cSecret| PswAdmin(cUser,cSecret) == 0}
    ConOut(ValType(bRead))
Return Nil
Expected result

Creates a block (type B), without querying, authenticating or changing users. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Historical reference: verify API, permissions and context for the target release. Never log credentials or user arrays.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. AdvPL — O Manual. Referência histórica, p. 365. Contrato atual não homologado. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha