| Last Update: | Aug 04, 2003 |
| Status: | Production |
| Version: | Any PDK Release |
Oracle9iAS Portal provides a set of APIs for the security mechanism that the PL/SQL portlets typically use. Portlet security refers to the techniques and methods used by portlets to control their access to end users. For an introductory overview of Security Services, please refer to the Primer on Security Services.
Oracle9iAS Portal strictly controls access to information and applications. This is accomplished by assigning specific privileges to users and groups. Portal security services allow you to specify access control programmatically and check for the appropriate privileges at runtime. The security mechanisms used by portlets ensure that only authorized users will have access to these portlets.
Security services are available through the wwsec_api package.
This article describes how the security services are implemented using the Services Example. It provides a guideline for adding the security service to your portlet functionality.The portal requires the method is_portlet_runnable to be implemented by database providers. This method implements portlet security. The actual implementation of this method is up to the application to be specified, i.e. the security scheme that determines whether or not the current user has enough privileges to access the portlet is defined by the individual portlet implementation.
The portal also requires the method get_portlet_list for database providers to return the right set of portlets that are accessible by the currently logged on user.
CREATE OR REPLACE
package body SERVICES_PROVIDER
is
function is_portlet_runnable
(
p_portlet_instance in wwpro_api_provider.portlet_instance_record
)
return boolean
is
begin
if (p_portlet_instance.portlet_id = SERVICES_PORTLET_ID) then
return services_portlet.is_runnable(
p_provider_id => p_portlet_instance.provider_id
,p_reference_path => p_portlet_instance.reference_path
);
else
raise wwpro_api_provider.PORTLET_NOT_FOUND_EXCEPTION;
end if;
end is_portlet_runnable;
...
end SERVICES_PROVIDER;
/
CREATE OR REPLACE
package body SERVICES_PROVIDER
is
...
function get_portlet_list (
p_provider_id in integer
,p_start_row in integer
,p_rowcount in integer
,p_language in varchar2
,p_security_level in boolean
,p_type in integer
)
return wwpro_api_provider.portlet_table
is
l_portlet_list wwpro_api_provider.portlet_table;
l_cnt number;
begin
l_cnt := 0;
if (p_security_level = false) then
l_cnt := l_cnt + 1;
l_portlet_list(l_cnt) := get_portlet(
p_provider_id => p_provider_id
,p_portlet_id => SERVICES_PORTLET_ID
,p_language => p_language
);
return l_portlet_list;
end if;
if (services_portlet.is_runnable(p_provider_id => p_provider_id
,p_reference_path => null)
) then
l_cnt := l_cnt + 1;
l_portlet_list(l_cnt) := get_portlet(
p_provider_id => p_provider_id
,p_portlet_id => SERVICES_PORTLET_ID
,p_language => p_language
);
end if;
return l_portlet_list;
end get_portlet_list;
...
end SERVICES_PROVIDER;
/
CREATE OR REPLACE
package body SERVICES_PORTLET
is
...
function get_portlet_info
(
p_provider_id in integer
,p_language in varchar2
)
return wwpro_api_provider.portlet_record
is
l_portlet wwpro_api_provider.portlet_record;
begin
-- Perform the Security Check
if not is_runnable(p_provider_id, null)
then
wwerr_api_error.add(DOMAIN, SUBDOMAIN,
'securityerr', 'services_portlet.get_portlet_info');
raise wwpro_api_provider.PROVIDER_SECURITY_EXCEPTION;
end if;
...
end SERVICES_PORTLET;
/
CREATE OR REPLACE
package body SERVICES_PORTLET
is
function is_runnable (
p_provider_id in integer
,p_reference_path in varchar2
)
return boolean
is
begin
/*
Portlet security check. It allows the portlet to be visible
if the user is logged on, i.e. the current session is not a
public session.
*/
return wwctx_api.is_logged_on;
end is_runnable;
...
procedure show
(
p_portlet_record wwpro_api_provider.portlet_runtime_record
)
is
l_portlet wwpro_api_provider.portlet_record;begin
-- Perform the Security Checkif not is_runnable(p_provider_id, null)
then
wwerr_api_error.add(DOMAIN, SUBDOMAIN,
'securityerr', 'services_portlet.show');
raise wwpro_api_provider.PROVIDER_SECURITY_EXCEPTION;
end if;
end show;
...
end SERVICES_PORTLET;
/
| Revision History: |
|
| Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065, USA http://www.oracle.com/ |
Worldwide Inquiries: 1-800-ORACLE1 Fax 650.506.7200 |
Copyright and Corporate Info |