Public paste
Undefined
By: Guest | Date: May 26 2010 11:21 | Format: None | Expires: never | Size: 580 B | Hits: 776

  1. public function testHasPermission()
  2.         {
  3.                 $db = FroxlorPDO::getInstance();
  4.  
  5.                 $db->query('TRUNCATE TABLE `acl_permissions`');
  6.  
  7.                 FroxlorACL::addPermission('Froxlor', 'ACL', 'test.*');
  8.                 FroxlorACL::addPermission('Froxlor', 'ACL', 'test.x');
  9.  
  10.                 /**
  11.                  * Only assign permissions to test.* to user 1
  12.                  * to see if this works
  13.                  */
  14.                 $db->query('TRUNCATE TABLE `acl_user_permissions`');
  15.  
  16.                 $this->acl->grantUser('Froxlor.ACL.test.x');
  17.  
  18.                 $permission = 'Froxlor.ACL.test.x';
  19.                 $result = $this->acl->hasPermission($permission);
  20.                 $this->assertTrue($result);
  21.    
  22.         }