def is_admin ( self ) : return self . role == self . roles . administrator . value and self . state == State . approved
python check to see if it is running as administrator
Is the user a system administrator
def is_admin(self):
        """Is the user a system administrator"""
        return self.role == self.roles.administrator.value and self.state == State.approved