def get(self, exploration_id): """Handles GET requests.""" if exploration_id in constants.DISABLED_EXPLORATION_IDS: self.render_template('pages/error/disabled_exploration.html', iframe_restriction=None) return (exploration, exploration_rights) = ( exp_services.get_exploration_and_exploration_rights_by_id( exploration_id)) visualizations_html = visualization_registry.Registry.get_full_html() interaction_ids = ( interaction_registry.Registry.get_all_interaction_ids()) interaction_dependency_ids = ( interaction_registry.Registry.get_deduplicated_dependency_ids( interaction_ids)) dependencies_html, additional_angular_modules = ( dependency_registry.Registry.get_deps_html_and_angular_modules( interaction_dependency_ids + self.EDITOR_PAGE_DEPENDENCY_IDS)) interaction_templates = (interaction_registry.Registry. get_interaction_html(interaction_ids)) self.values.update({ 'INTERACTION_SPECS': interaction_registry.Registry.get_all_specs(), 'DEFAULT_OBJECT_VALUES': obj_services.get_default_object_values(), 'DEFAULT_TWITTER_SHARE_MESSAGE_EDITOR': (DEFAULT_TWITTER_SHARE_MESSAGE_EDITOR.value), 'additional_angular_modules': additional_angular_modules, 'can_delete': rights_manager.check_can_delete_activity(self.user, exploration_rights), 'can_edit': rights_manager.check_can_edit_activity(self.user, exploration_rights), 'can_modify_roles': (rights_manager.check_can_modify_activity_roles( self.user, exploration_rights)), 'can_publish': rights_manager.check_can_publish_activity(self.user, exploration_rights), 'can_release_ownership': (rights_manager.check_can_release_ownership( self.user, exploration_rights)), 'can_translate': (rights_manager.check_can_translate_activity( self.user, exploration_rights)), 'can_unpublish': rights_manager.check_can_unpublish_activity( self.user, exploration_rights), 'dependencies_html': jinja2.utils.Markup(dependencies_html), 'interaction_templates': jinja2.utils.Markup(interaction_templates), 'meta_description': feconf.CREATE_PAGE_DESCRIPTION, 'nav_mode': feconf.NAV_MODE_CREATE, 'value_generators_js': jinja2.utils.Markup(get_value_generators_js()), 'title': exploration.title, 'visualizations_html': jinja2.utils.Markup(visualizations_html), 'ALLOWED_INTERACTION_CATEGORIES': (feconf.ALLOWED_INTERACTION_CATEGORIES), 'INVALID_PARAMETER_NAMES': feconf.INVALID_PARAMETER_NAMES, 'NEW_STATE_TEMPLATE': NEW_STATE_TEMPLATE, 'SHOW_TRAINABLE_UNRESOLVED_ANSWERS': (feconf.SHOW_TRAINABLE_UNRESOLVED_ANSWERS), 'TAG_REGEX': feconf.TAG_REGEX, }) self.render_template( 'pages/exploration_editor/exploration_editor.html', redirect_url_on_logout=( '%s/%s' % (feconf.EDITOR_URL_PREFIX, exploration_id)))
def test_check_cannot_modify_activity_roles_with_no_activity_rights(self): self.assertFalse( rights_manager.check_can_modify_activity_roles(self.owner, None))