save_resource_custom_access()

Description

Saves custom access settings for a specific resource.

This function retrieves custom access groups associated with the given resource,
deletes existing custom access records for that resource, and then inserts new
access settings based on user input.

Parameters

ColumnTypeDefaultDescription
$resource int The resource reference ID for which custom access is being set.

Return

void

Location

include/resource_functions.php lines 3887 to 3896

Definition

 
function save_resource_custom_access($resource)
{
    
$groups get_resource_custom_access($resource);
    
ps_query("delete from resource_custom_access where resource=? and usergroup is not null", array("i",$resource));
    for (
$n 0$n count($groups); $n++) {
        
$usergroup $groups[$n]["ref"];
        
$access getval("custom_" $usergroup0);
        
ps_query("insert into resource_custom_access(resource,usergroup,access) values (?,?,?)", array("i",$resource,"i",$usergroup,"i",$access));
    }
}

This article was last updated 18th March 2025 15:05 Europe/London time based on the source file dated 6th March 2025 14:30 Europe/London time.