Hi Jeremy,

thank you for your answer. I followed your hint modifyng
(for example) the  ucsc_tablebrowser.xml as follows (not
sure about the <display> tag to have a simple error
message, but this is another problem):

<tool name="UCSC Main" id="ucsc_table_direct1" tool_type="data_source">
    <description>table browser</description>
    <command interpreter="python">
        #if $__user_email__ == ""
        <display>You are not authorized to use this tool</display>
        data_source.py $output $__app__.config.output_size_limit
        #end if

... and I got the error below, which seems connected to
the cheetah syntax. Any idea of what I'm doing wrong?

Traceback (most recent call last):
File "/home/galaxy/galaxy-dist/lib/galaxy/jobs/runners/local.py", line 58, in run_job
File "/home/galaxy/galaxy-dist/lib/galaxy/jobs/__init__.py", line 411, in prepare
    self.command_line = self.tool.build_command_line( param_dict )
File "/home/galaxy/galaxy-dist/lib/galaxy/tools/__init__.py", line 1691, in build_command_line
    command_line = fill_template( self.command, context=param_dict )
File "/home/galaxy/galaxy-dist/lib/galaxy/util/template.py", line 9, in fill_template
    return str( Template( source=template_text, searchList=[context] ) )
File "/home/galaxy/galaxy-dist/eggs/Cheetah-2.2.2-py2.5-linux-x86_64-ucs4.egg/Cheetah/Template.py", line 1244, in __init__
    self._compile(source, file, compilerSettings=compilerSettings)
File "/home/galaxy/galaxy-dist/eggs/Cheetah-2.2.2-py2.5-linux-x86_64-ucs4.egg/Cheetah/Template.py", line 1538, in _compile
File "/home/galaxy/galaxy-dist/eggs/Cheetah-2.2.2-py2.5-linux-x86_64-ucs4.egg/Cheetah/Template.py", line 745, in compile
File "/home/galaxy/galaxy-dist/eggs/Cheetah-2.2.2-py2.5-linux-x86_64-ucs4.egg/Cheetah/Compiler.py", line 1670, in compile
File "/home/galaxy/galaxy-dist/eggs/Cheetah-2.2.2-py2.5-linux-x86_64-ucs4.egg/Cheetah/Parser.py", line 1496, in parse
File "/home/galaxy/galaxy-dist/eggs/Cheetah-2.2.2-py2.5-linux-x86_64-ucs4.egg/Cheetah/Parser.py", line 2658, in assertEmptyOpenDirectivesStack
    raise ParseError(self, msg=errorMsg)

Some #directives are missing their corresponding #end ___ tag: if
Line 2, column 8

Line|Cheetah Code
2   |


#if $__user_email__ == ""
<display>You are not authorized to use this tool</display>

<command interpreter="python">
data_source.py $output $__app__.config.output_size_limit

To make this approach work, the email check should go in the command tag.

More information:

If you're looking to require users to login before using any tools, you
can use this flag in the universe config file:

# Force everyone to log in (disable anonymous access).
#require_login = False

If you're looking to implement tool-based access control, the best
approach is probably to use the same role-based approach that libraries use:



Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:


Reply via email to