ashb commented on a change in pull request #4973: [AIRFLOW-4155] Allow Public 
role access to /home
URL: https://github.com/apache/airflow/pull/4973#discussion_r268804775
 
 

 ##########
 File path: tests/www/test_security.py
 ##########
 @@ -308,3 +308,26 @@ def test_override_role_vm(self):
         test_security_manager = TestSecurityManager(appbuilder=self.appbuilder)
         self.assertEqual(len(test_security_manager.VIEWER_VMS), 1)
         self.assertEqual(test_security_manager.VIEWER_VMS, {'Airflow'})
+
+    def test_is_user_logged_in_returns_false_if_not_authenticated(self):
+        user = mock.MagicMock()
+        user.is_authenticated = False
+        self.assertFalse(self.security_manager.is_user_logged_in(user))
+
+    def test_is_user_logged_in_returns_true_if_authenticated(self):
+        user = mock.MagicMock()
+        user.is_authenticated = True
+        self.assertTrue(self.security_manager.is_user_logged_in(user))
+
+    def test_unauthenticated_user_is_public(self):
+        user = mock.MagicMock()
+        user.is_authenticated = False
+        self.assertTrue(self.security_manager.is_public_user(user))
 
 Review comment:
   I was suggesting that  instead of allowing Public role access to anything in 
 Airflow that we change the signup role to be Viewer, say.
   
   ```
   AUTH_USER_REGISTRATION_ROLE = 'Public'
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to