Code Duplication    Length = 8-8 lines in 2 locations

timesheet/inc/class.timesheet_bo.inc.php 1 location

@@ 363-370 (lines=8) @@
360
			if (!$data) return null; 	// entry not found
361
		}
362
		if (!$user) $user = $this->user;
363
		if ($user == $this->user)
364
		{
365
			$grants = $this->grants;
366
		}
367
		else
368
		{
369
			$grants = $GLOBALS['egw']->acl->get_grants(TIMESHEET_APP,true,$user);
370
		}
371
		$ret = $data && !!($grants[$data['ts_owner']] & $required);
372
373
		if(($required & Acl::DELETE) && $this->config_data['history'] == 'history' &&

calendar/inc/class.calendar_bo.inc.php 1 location

@@ 1279-1286 (lines=8) @@
1276
	function check_perms($needed,$event=0,$other=0,$date_format='ts',$date_to_read=null,$user=null)
1277
	{
1278
		if (!$user) $user = $this->user;
1279
		if ($user == $this->user)
1280
		{
1281
			$grants = $this->grants;
1282
		}
1283
		else
1284
		{
1285
			$grants = $GLOBALS['egw']->acl->get_grants('calendar',true,$user);
1286
		}
1287
1288
		if ($other && !is_numeric($other))
1289
		{