Преглед на файлове

[oozie] Fix edition permission on Coordinator

Hide history of non editable workflow
Updated backend doc in ini
Fixed typo in manual doc
Romain Rigaux преди 13 години
родител
ревизия
9b21d6efae

+ 12 - 12
apps/oozie/src/oozie/templates/editor/edit_coordinator.mako

@@ -42,7 +42,7 @@ ${ layout.menubar(section='coordinators') }
   <ul class="nav nav-tabs">
     <li class="active"><a href="#editor" data-toggle="tab">${ _('Editor') }</a></li>
     <li><a href="#datasets" data-toggle="tab">${ _('Datasets') }</a></li>
-    % if can_edit_coordinator:
+    % if coordinator.is_editable(user):
       <li><a href="#history" data-toggle="tab">${ _('History') }</a></li>
     % endif
   </ul>
@@ -138,7 +138,7 @@ ${ layout.menubar(section='coordinators') }
                       <th width="10%">${ _('Name') }</th>
                       <th width="10%">${ _('Dataset') }</th>
                       <th>${ _('Path') }</th>
-                      % if can_edit_coordinator:
+                      % if coordinator.is_editable(user):
                         <th width="1%">${ _('Delete') }</th>
                       % endif
                     </tr>
@@ -150,7 +150,7 @@ ${ layout.menubar(section='coordinators') }
                          <td>${ form['name'] }</td>
                          <td>${ form['dataset'] }</td>
                          <td>${ form['dataset'].form.instance.dataset.uri }</td>
-                         % if can_edit_coordinator:
+                         % if coordinator.is_editable(user):
                            <td><a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a></td>
                          % endif
                       </tr>
@@ -167,7 +167,7 @@ ${ layout.menubar(section='coordinators') }
                 ${ _('No inputs') }
               </div>
 
-              % if can_edit_coordinator:
+              % if coordinator.is_editable(user):
                 ${ coordinator_data.print_datasets(_('Datasets'), 'dataset_input', new_data_input_formset, 'input', not len(data_input_formset.forms)) }
               % endif
             </div>
@@ -185,7 +185,7 @@ ${ layout.menubar(section='coordinators') }
                     <th width="10%">${ _('Name') }</th>
                     <th width="10%">${ _('Dataset') }</th>
                     <th>${ _('Path') }</th>
-                    % if can_edit_coordinator:
+                    % if coordinator.is_editable(user):
                       <th width="1%">${ _('Delete') }</th>
                     % endif
                   </tr>
@@ -197,7 +197,7 @@ ${ layout.menubar(section='coordinators') }
                       <td>${ form['name'] }</td>
                       <td>${ form['dataset'] }</td>
                       <td>${ form['dataset'].form.instance.dataset.uri }</td>
-                      % if can_edit_coordinator:
+                      % if coordinator.is_editable(user):
                         <td><a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a></td>
                       % endif
                     </tr>
@@ -214,7 +214,7 @@ ${ layout.menubar(section='coordinators') }
                 ${ _('No outputs') }
               </div>
 
-              % if can_edit_coordinator:
+              % if coordinator.is_editable(user):
                 ${ coordinator_data.print_datasets(_('Datasets'), 'dataset_output', new_data_output_formset, 'output', not len(data_output_formset.forms)) }
               % endif
             </div>
@@ -226,7 +226,7 @@ ${ layout.menubar(section='coordinators') }
     <div class="tab-pane" id="datasets">
       <div class="row-fluid">
           <div class="span1">
-            % if can_edit_coordinator:
+            % if coordinator.is_editable(user):
               <table cellpadding="5">
                 <thead>
                   <tr>
@@ -255,7 +255,7 @@ ${ layout.menubar(section='coordinators') }
                       <th>${ _('Uri') }</th>
                       <th>${ _('Timezone') }</th>
                       <th>${ _('Done flag') }</th>
-                      % if can_edit_coordinator:
+                      % if coordinator.is_editable(user):
                         <td>${ _('Delete') }</td>
                       % endif
                     </tr>
@@ -267,7 +267,7 @@ ${ layout.menubar(section='coordinators') }
                     % endfor
                     <tr>
                       <td>
-                        % if can_edit_coordinator:
+                        % if coordinator.is_editable(user):
                           <a href="javascript:modalRequest('${ url('oozie:edit_coordinator_dataset', dataset=form.instance.id) }', '#edit-dataset-modal');"
                              data-row-selector="true"/>
                         % endif
@@ -279,7 +279,7 @@ ${ layout.menubar(section='coordinators') }
                       <td>${ form.instance.uri }</td>
                       <td>${ form.instance.timezone }</td>
                       <td>${ form.instance.done_flag }</td>
-                      % if can_edit_coordinator:
+                      % if coordinator.is_editable(user):
                         <td data-row-selector-exclude="true">
                           <a class="btn btn-small delete-row" href="javascript:void(0);">${ _('Delete') }${ form['DELETE'] }</a>
                         </td>
@@ -309,7 +309,7 @@ ${ layout.menubar(section='coordinators') }
        </div>
     </div>
 
-    % if can_edit_coordinator:
+    % if coordinator.is_editable(user):
       <div class="tab-pane" id="history">
         <table class="table">
           <thead>

+ 28 - 24
apps/oozie/src/oozie/templates/editor/edit_workflow.mako

@@ -45,7 +45,9 @@ ${ layout.menubar(section='workflows') }
   <ul class="nav nav-tabs">
     <li class="active"><a href="#editor" data-toggle="tab">${ _('Editor') }</a></li>
     <li><a href="#properties" data-toggle="tab">${ _('Properties') }</a></li>
-    <li><a href="#history" data-toggle="tab">${ _('History') }</a></li>
+    % if user_can_edit_job:
+      <li><a href="#history" data-toggle="tab">${ _('History') }</a></li>
+    % endif
   </ul>
 
   <form class="form-horizontal" id="jobForm" action="${ url('oozie:edit_workflow', workflow=workflow.id) }" method="POST">
@@ -167,31 +169,33 @@ ${ layout.menubar(section='workflows') }
         <div class="span3"></div>
       </div>
 
-      <div class="tab-pane" id="history">
-        % if not history:
-          ${ _('N/A') }
-        % else:
-        <table class="table">
-          <thead>
-            <tr>
-              <th>${ _('Date') }</th>
-              <th>${ _('Id') }</th>
-            </tr>
-          </thead>
-          <tbody>
-            % for record in history:
+      % if user_can_edit_job:
+        <div class="tab-pane" id="history">
+          % if not history:
+            ${ _('N/A') }
+          % else:
+          <table class="table">
+            <thead>
               <tr>
-                <td>
-                  <a href="${ url('oozie:list_history_record', record_id=record.id) }" data-row-selector="true"></a>
-                  ${ utils.format_date(record.submission_date) }
-                </td>
-                <td>${ record.oozie_job_id }</td>
+                <th>${ _('Date') }</th>
+                <th>${ _('Id') }</th>
               </tr>
-            % endfor
-          </tbody>
-        </table>
-        % endif
-      </div>
+            </thead>
+            <tbody>
+              % for record in history:
+                <tr>
+                  <td>
+                    <a href="${ url('oozie:list_history_record', record_id=record.id) }" data-row-selector="true"></a>
+                    ${ utils.format_date(record.submission_date) }
+                  </td>
+                  <td>${ record.oozie_job_id }</td>
+                </tr>
+              % endfor
+            </tbody>
+          </table>
+          % endif
+        </div>
+      % endif
     </div>
   </form>
 </div>

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -74,6 +74,9 @@
     # - desktop.auth.backend.AllowAllBackend (allows everyone)
     # - desktop.auth.backend.AllowFirstUserDjangoBackend
     #     (Default. Relies on Django and user manager, after the first login)
+    # - desktop.auth.backend.LdapBackend
+    # - desktop.auth.backend.PamBackend
+    ## backend=desktop.auth.backend.AllowFirstUserDjangoBackend
 
     ## pam_service=login
 

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -83,6 +83,9 @@
     # - desktop.auth.backend.AllowAllBackend (allows everyone)
     # - desktop.auth.backend.AllowFirstUserDjangoBackend
     #     (Default. Relies on Django and user manager, after the first login)
+    # - desktop.auth.backend.LdapBackend
+    # - desktop.auth.backend.PamBackend
+    ## backend=desktop.auth.backend.AllowFirstUserDjangoBackend
 
     ## pam_service=login
 

+ 1 - 1
docs/manual.txt

@@ -60,7 +60,7 @@ tarball, you must have the following installed:
 Redhat,Ubuntu
 ~~~~~~~~~~
 gcc,gcc
-g+,g++
+g++,g++
 libxml2-devel,libxml2-dev
 libxslt-devel,libxslt-dev
 cyrus-sasl-devel,libsasl2-dev