(self, user)
| 597 | @check_authorization |
| 598 | @inject_user |
| 599 | def get(self, user): |
| 600 | auth = self.application.auth |
| 601 | authorizer = self.application.authorizer |
| 602 | |
| 603 | username = None |
| 604 | if auth.is_enabled(): |
| 605 | username = auth.get_username(self) |
| 606 | |
| 607 | try: |
| 608 | admin_rights = has_admin_rights(self) |
| 609 | except Exception: |
| 610 | admin_rights = False |
| 611 | |
| 612 | info = { |
| 613 | 'enabled': auth.is_enabled(), |
| 614 | 'username': username, |
| 615 | 'admin': admin_rights, |
| 616 | 'canEditCode': authorizer.can_edit_code(user.user_id) |
| 617 | } |
| 618 | |
| 619 | self.write(info) |
| 620 | |
| 621 | |
| 622 | class AuthConfigHandler(BaseRequestHandler): |
nothing calls this directly
no test coverage detected