equal
deleted
inserted
replaced
793 |
793 |
794 @allowDeveloper |
794 @allowDeveloper |
795 @denySidebar |
795 @denySidebar |
796 def checkIsAllowedToManageRole(self, django_args, role_logic, manage_role_logic): |
796 def checkIsAllowedToManageRole(self, django_args, role_logic, manage_role_logic): |
797 """Returns an alternate HTTP response if the user is not allowed to manage |
797 """Returns an alternate HTTP response if the user is not allowed to manage |
798 the role given in args. |
798 the role given in args. |
|
799 |
|
800 Args: |
|
801 role_logic: determines the logic for the role in args. |
|
802 manage_role_logic: determines the logic for the role which is allowed |
|
803 to manage this role. |
799 |
804 |
800 Raises: |
805 Raises: |
801 AccessViolationResponse: if the required authorization is not met |
806 AccessViolationResponse: if the required authorization is not met |
802 |
807 |
803 Returns: |
808 Returns: |
804 None if the current User has an active role for the given role_logic. |
809 None if the given role is active and belongs to the current user. |
805 None if the current User has an active managing role |
810 None if the current User has an active role (from manage_role_logic) |
|
811 that belongs to the same scope as the role that needs to be managed |
806 """ |
812 """ |
807 |
813 |
808 try: |
814 try: |
809 # check if it is my role the user's own role |
815 # check if it is my role the user's own role |
810 self.checkIsMyActiveRole(django_args, role_logic) |
816 self.checkIsMyActiveRole(django_args, role_logic) |