<?php

class Tac_StopHumanSpam_Model_Perms extends XenForo_Model
{
	public function getPermissions(array $viewingUser = null)
	{
		$this->standardizeViewingUserReference($viewingUser);			
		if(!array_key_exists('permissions', $viewingUser))
		{
			$viewingUser['permissions'] = XenForo_Permission::unserializePermissions($viewingUser['global_permission_cache']);
		}
		
		
		$perms['canBypassLinkPostRules'] 	= (XenForo_Permission::hasPermission($viewingUser['permissions'], 'stopHumanSpam', 'canBypassLinkPostRules') ? true : false);
		$perms['canBypassSigModRules'] 		= (XenForo_Permission::hasPermission($viewingUser['permissions'], 'stopHumanSpam', 'canBypassSigModRules') ? true : false);
		$perms['canBypassStopBannedWords']	= (XenForo_Permission::hasPermission($viewingUser['permissions'], 'stopHumanSpam', 'canBypassStopBannedWords') ? true : false);
		$perms['canBypassStopSneakyUrls'] 	= (XenForo_Permission::hasPermission($viewingUser['permissions'], 'stopHumanSpam', 'canBypassStopSneakyUrls') ? true : false);	
		$perms['canBypassPhoneNumberRules'] = (XenForo_Permission::hasPermission($viewingUser['permissions'], 'stopHumanSpam', 'canBypassPhoneNumberRules') ? true : false);	  	
		return $perms;
	}
	
}