Granting Page Level Privileges

15-6 Oracle Fusion Middleware Developers Guide for Oracle Portal p_folder_id = 45 ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; ■ p_master_item_id is the master ID of the item. You can find this value in the MASTERID column of the WWSBR_ALL_ITEMS view. ■ p_caid is the ID of the page group to which the item belongs. ■ p_folder_id is the ID of the page on which the item appears.

15.3.1 Granting Item Level Privileges

After enabling ILS for the item, you can define access privileges for one or more users or groups. When setting item level privileges, the type of privileges that are granted is dependent on which of the following parameters are passed rather than the parameter values: ■ Pass an array of user IDs to p_itemown_user to grant the Manage privilege to a list of users. ■ Pass an array of user IDs to p_itemmanage_user to grant the Edit privilege to a list of users. ■ Pass an array of user IDs to p_itemview_user to grant the View privilege to a list of users. ■ Pass an array of group IDs to p_itemown_group to grant the Manage privilege to a list of groups. ■ Pass an array of group IDs to p_itemmanage_group to grant the Edit privilege to a list of groups. ■ Pass an array of group IDs to p_itemview_group to grant the View privilege to a list of groups. You can pass values to any combination of these parameters in the same procedure call to set a range of privileges across different users and groups. Example 15–9 shows how you can use the add_item_ils_privileges API to grant item-level privileges to users. Example 15–9 Granting Item Level Privileges to Users add_item_ils_privileges API declare l_itemown_username_array wwsbr_type.array; l_itemown_userid_array wwsbr_type.array; begin l_itemown_username_array1 := jsmith; l_itemown_username_array2 := janesmith; l_itemown_username_array3 := joedoe; Tip: If you want to edit other attributes for the item as well as the ILS setting, you can use the modify_item or modify_item_post_ upload APIs instead. To enable ILS set the p_access_level parameter to wwsbr_api.ITEM_ACCESS, to disable ILS set the parameter to wwsbr_api.FOLDER_ACCESS. Implementing Content Security 15-7 for i in 1 .. l_itemown_username_array.count loop -- Get the user ID from the wwsec_api.id_sso API. l_itemown_userid_arrayi := wwsec_api.id_sso p_username = l_itemown_username_arrayi ; end loop; wwsbr_api.add_item_ils_privileges p_master_item_id = 453, p_caid = 33, p_folder_id = 45, p_itemown_user = l_itemown_userid_array ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; ■ p_master_item_id is the master ID of the item. You can find this value in the MASTERID column of the WWSBR_ALL_ITEMS view. ■ p_caid is the ID of the page group to which the item belongs. ■ p_folder_id is the ID of the page on which the item appears. ■ p_itemown_user is an array of user IDs to which you want to grant Manage privileges. If you pass the same user or group in more than one of the privilege arrays, the user or group is granted the highest privilege level specified.

15.3.2 Removing Item Level Privileges

If for some reason, you need to remove a user or groups privileges on an item, use the delete_ils_privilege API, as shown in Example 15–10 . Example 15–10 Removing Item Level Privileges delete_ils_privilege API declare l_user_id number := 334; l_page_group_id number := 75; l_page_id number := 1; l_item_id number := 74637; begin wwsbr_api.delete_ils_privilege p_user_or_group_id = l_user_id, p_caid = l_page_group_id, p_folder_id = l_page_id, p_master_item_id = l_item_id ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; Tip: You can also update the access privileges for an item using the add_item_ils_privileges API.