function requireSecurityGroup($category, $value, $type = 'module') { global $current_user; if (is_admin($current_user)) { return false; } return ACLAction::userNeedsSecurityGroup($current_user->id, $category, $value, $type); }
public function testuserNeedsSecurityGroup() { $this->assertFalse(ACLAction::userNeedsSecurityGroup('1', '', '')); //test with empty module and action $this->assertFalse(ACLAction::userNeedsSecurityGroup('1', 'Accounts', 'list')); //test with valid module and action }