Changeset - 0b046b32a462
[Not reviewed]
0 1 0
Lance Edgar (lance) - 3 months ago 2024-08-05 14:29:05
lance@edbob.org
fix: method for `AuthHandler.user_is_admin()` moved upstream
1 file changed with 0 insertions and 16 deletions:
0 comments (0 inline, 0 general)
rattail/auth.py
Show inline comments
 
@@ -86,22 +86,6 @@ class RattailAuthHandler(base.AuthHandler, MergeMixin):
 
    # extra methods
 
    ##############################
 

	
 
    def user_is_admin(self, user, **kwargs):
 
        """
 
        Check if given user is a member of the "Administrator" role.
 

	
 
        :rtype: bool
 
        """
 
        if not user:
 
            return False
 

	
 
        session = self.app.get_session(user)
 
        admin = self.get_role_administrator(session)
 
        if admin in user.roles:
 
            return True
 

	
 
        return False
 

	
 
    def authenticate_user_token(self, session, token):
 
        """
 
        Authenticate the given user API token string, and if valid,
0 comments (0 inline, 0 general)