Пример #1
0
    def render(self, session, dbuser, domain, comments, compiler_version,
               autosync, change_manager, allow_manage, **arguments):
        dbdomain = Domain.get_unique(session, domain, compel=True)

        # FIXME: proper authorization
        if dbdomain.owner != dbuser and dbuser.role.name != 'aqd_admin':
            raise AuthorizationException("Only the owner or an AQD admin can "
                                         "update a domain.")

        if comments:
            dbdomain.comments = comments
        if compiler_version:
            dbdomain.compiler = expand_compiler(self.config, compiler_version)
        if autosync is not None:
            dbdomain.autosync = autosync
        if change_manager is not None:
            if dbdomain.tracked_branch:
                raise ArgumentError("Cannot enforce a change manager for "
                                    "tracking domains.")
            dbdomain.requires_change_manager = change_manager
        if allow_manage is not None:
            dbdomain.allow_manage = allow_manage

        session.flush()
        return
Пример #2
0
    def render(self, session, dbuser, domain, comments, compiler_version,
               autosync, change_manager, allow_manage, **arguments):
        dbdomain = Domain.get_unique(session, domain, compel=True)

        # FIXME: proper authorization
        if dbdomain.owner != dbuser and dbuser.role.name != 'aqd_admin':
            raise AuthorizationException("Only the owner or an AQD admin can "
                                         "update a domain.")

        if comments:
            dbdomain.comments = comments
        if compiler_version:
            dbdomain.compiler = expand_compiler(self.config, compiler_version)
        if autosync is not None:
            dbdomain.autosync = autosync
        if change_manager is not None:
            if dbdomain.tracked_branch:
                raise ArgumentError("Cannot enforce a change manager for "
                                    "tracking domains.")
            dbdomain.requires_change_manager = change_manager
        if allow_manage is not None:
            dbdomain.allow_manage = allow_manage

        session.flush()
        return
Пример #3
0
    def render(self, session, dbuser, sandbox, comments, compiler_version,
               autosync, **arguments):
        dbsandbox = Sandbox.get_unique(session, sandbox, compel=True)

        # FIXME: proper authorization
        if dbsandbox.owner != dbuser and dbuser.role.name != 'aqd_admin':
            raise AuthorizationException("Only the owner or an AQD admin can "
                                         "update a sandbox.")

        if comments:
            dbsandbox.comments = comments
        if compiler_version:
            dbsandbox.compiler = expand_compiler(self.config, compiler_version)
        if autosync is not None:
            dbsandbox.autosync = autosync

        session.flush()
        return
Пример #4
0
    def render(self, session, dbuser, sandbox, comments, compiler_version,
               autosync, **arguments):
        dbsandbox = Sandbox.get_unique(session, sandbox, compel=True)

        # FIXME: proper authorization
        if dbsandbox.owner != dbuser and dbuser.role.name != 'aqd_admin':
            raise AuthorizationException("Only the owner or an AQD admin can "
                                         "update a sandbox.")

        if comments:
            dbsandbox.comments = comments
        if compiler_version:
            dbsandbox.compiler = expand_compiler(self.config, compiler_version)
        if autosync is not None:
            dbsandbox.autosync = autosync

        session.flush()
        return