function testUserInRole() { $userId = 3; $objAuth1 = new ObjectAuthAssignment(); $objAuth1->objectType = 'Election'; $objAuth1->objectId = 1; $this->assertTrue($objAuth1->checkUserInRole($userId, 'election_creator')); $objAuth2 = new ObjectAuthAssignment(); $objAuth2->objectType = 'Election'; $objAuth2->objectId = 2; $this->assertFalse($objAuth2->checkUserInRole($userId, 'election_creator')); }
public function checkUserInRole($userId, $roleName) { return $this->_oaa->checkUserInRole($userId, $roleName); }