function requireOwner($category, $value, $type = 'module') { global $current_user; if (is_admin($current_user)) { return false; } return ACLAction::userNeedsOwnership($current_user->id, $category, $value, $type); }
public function testuserNeedsOwnership() { //test with invalid values $this->assertFalse(ACLAction::userNeedsOwnership('', '', '')); //test with valid values for different module and action combination $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Accounts', 'list')); $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Accounts', 'delete')); $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Users', 'delete')); $this->assertFalse(ACLAction::userNeedsOwnership('1', 'Users', 'list')); }