NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_requestauthorize(n) 5.0.0a naviserver "NaviServer Built-in Commands"

Name

ns_requestauthorize - Authorization check

Table Of Contents

Synopsis

Description

This function does the same permission check that NaviServer does before serving a URL. In order to perform permission checks, authentication procs have to be registered.

One implementation which registers such callbacks is the nsperm module to perform basic HTTP authorization. For configuration and setup details of the nsperm module see nsperm - NaviServer Permissions and Access Control Guide.

The permission and authorization checks of NaviServer are not hard-coded. Many packages based on NaviServer (such as e.g., OpenACS) provide their own permissiion checking logic.

COMMANDS

ns_requestauthorize method url authuser authpasswd ?ipaddr?

Performs the same permission check that NaviServer does before serving a URL, but performs it in the provided context, checking permission for the provided method, url, authuser and authpasswd, and optionally an ipaddr.

The following values can be returned:

  • OK - The user has permission to execute this URL and method

  • ERROR - There was an error performing the check.

  • FORBIDDEN - There is no possible user/password/IP address combination that would give authorization.

  • UNAUTHORIZED - The user does not have permission to execute this URL and method.

Keywords

nsperm, server built-in