Oracle9iAS Portal Developer Kit

has_privilege function (one of a list)

Contained in package wwsec_api.

Call this function to determine if the specified user, or a group to which the user belongs, has at least one of a list of privileges.

function has_privilege

(

p_object_type_name in varchar2,

p_name in varchar2,

p_privilege_array in wwsec_api.array,

p_owner in varchar2 default wwctx_api.get_product_schema

p_reqd_auth_level in NUMBER default wwctx_api.REQUIRED_AUTHENTICATION_LEVEL

)

return boolean;

Version: Oracle Portal 3.0.6.6.5 or later

Parameters:

p_object_type_name

The name of the type of object referenced.

Note: These names can be specified with object_type_name constants. For example, ADMIN_OBJ,
ITEM_OBJ, or another object type name.

Datatype: in varchar2

p_name

The unique name of the specific object.

Datatype: in varchar2

p_privilege_array

A list of privileges.

Note: These names are specified with privilege name constants of the wwsec_api package.

Datatype: in wwsec_api.array

p_owner

The name of the schema that owns the Access Control List entry, or another name space discriminator.

Datatype: in varchar2
Default: wwctx_api.get_product_schema

p_reqd_auth_level

The minimum authentication level that a calling function requires in order to pass a privilege check.

The API fails the authorization check if the current authentication level (returned by wwctx_api.get_authentication_level) is less than the value of this parameter.

Note: If the object is granted PUBLIC access, the authentication level is not checked at all.

The default value for this parameter is REQUIRED_AUTHENTICATION_LEVEL and this is equivalent to PUBLIC_AUTHENTICATION. This implies that the user must be authenticated by the Single Sign-On Server for the authorization check to pass.

Portlets that require authorization fail the authorization check for a weakly authenticated user. If a portlet wants to display itself to a weakly authenticated user, it should pass p_reqd_auth_level as WEAK_AUTHENTICATION while invoking the authorization APIs.

Note: This parameter is available in Oracle Portal 3.0.9 or later.

Datatype: number
Default: wwctx_api.REQUIRED_AUTHENTICATION_LEVEL

Returns:

This function returns TRUE if p_privilege_array returns at least one privilege associated with the specified user. Otherwise it returns FALSE.

Exceptions:

This function raises no exceptions.

Example:

l_return boolean;
l_priv_array wwsec_api.array;
l_priv_array(1):= wwsec_api.MANAGE_PRIV;
l_priv_array(2):= wwsec_api.CREATE_PRIV;
l_return := wwsec_api.has_privilege
(

p_object_type_name => wwsec_api.PAGE_OBJ,
p_name => '0/156',
p_privilege_array => l_priv_array,
p_reqd_auth_level=>wwctx_api.REQUIRED_AUTHENTICATION_LEVEL

);

Related topics

The PL/SQL API Reference is part of the Portal Developer Kit on Portal Studio