def test_permission_editor(self):
     setRoles(self.portal, TEST_USER_ID, ['Contributor', 'Editor'])
     login(self.portal, TEST_USER_NAME)
     viewlet = SimpleLayoutAlignActionViewlet(self.portal, self.portal.REQUEST, 'simplelayout')
     self.assertTrue(viewlet.has_permission())
 def test_permission_reader(self):
     setRoles(self.portal, TEST_USER_ID, ['Reader'])
     login(self.portal, TEST_USER_NAME)
     viewlet = SimpleLayoutAlignActionViewlet(self.portal, self.portal.REQUEST, 'simplelayout')
     self.assertFalse(viewlet.has_permission())
     logout()