[Vtigercrm-developers] UserInfoUtil isPermitted() logic

Adam Heinz amh at metricwise.net
Fri Jan 27 11:59:35 PST 2012


So if I'm reading this right, we have a ternary value here?

$profileActionPermission[$tabid][$actionid]
if null, then return "yes"
if 1, then return "no"
if 0, then continue in function?

If that assessment is correct, I guess why question is, "Why does it
work this way?"  I would think that if you haven't explicitly been
granted a permission, you shouldn't have it?

Excerpt from http://trac.vtiger.com/svn/vtiger/vtigercrm/trunk/include/utils/UserInfoUtil.php,
lines 849-856

	//Checking for Action Permission
	if(strlen($profileActionPermission[$tabid][$actionid]) <  1 &&
$profileActionPermission[$tabid][$actionid] == '')
	{
		$permission = "yes";
		$log->debug("Exiting isPermitted method ...");
		return $permission;
	}	
	
	if($profileActionPermission[$tabid][$actionid] != 0 &&
$profileActionPermission[$tabid][$actionid] != '')
	{
		$permission = "no";
		$log->debug("Exiting isPermitted method ...");
		return $permission;
	}



More information about the vtigercrm-developers mailing list