소스 검색

Adds new permission for setting files permanent

Stephen Ficklin 3 년 전
부모
커밋
e56e83a6c6
3개의 변경된 파일13개의 추가작업 그리고 4개의 파일을 삭제
  1. BIN
      docs/user_guide/file_upload_permission.png
  2. 7 4
      tripal/includes/tripal.user.inc
  3. 6 0
      tripal/tripal.module

BIN
docs/user_guide/file_upload_permission.png


+ 7 - 4
tripal/includes/tripal.user.inc

@@ -519,10 +519,13 @@ function tripal_view_file($uid, $fid) {
 
 
   $actions = l('Delete', "user/$uid/files/$file->fid/delete") . '<br>' .
-      l('Download', "user/$uid/files/$file->fid/download") . '<br>' .
-      l('Renew Expiration', "user/$uid/files/$file->fid/renew") . '<br>';
-  if ($expiration_date != -1) {
-    $actions .= l('Make Permanent', "user/$uid/files/$file->fid/permanent");
+    l('Download', "user/$uid/files/$file->fid/download") . '<br>' .
+    l('Renew Expiration', "user/$uid/files/$file->fid/renew") . '<br>';
+
+  if (user_access('make files permanent')) {
+    if ($expiration_date != -1) {
+      $actions .= l('Make Permanent', "user/$uid/files/$file->fid/permanent");
+    }
   }
   $rows[] = [
     [

+ 6 - 0
tripal/tripal.module

@@ -747,6 +747,12 @@ function tripal_permission() {
       'title' => t('Upload Files'),
       'description' => t('Allows the user to upload files using Tripal\'s HTML5 loader.'),
     ),
+    'make files permanent' => array(
+      'title' => t('Make Files Permanent'),
+      'description' => t('Allows the user to make files they have access to ' .
+         'permanent. Files that are permanent will not expire and will not ' .
+         'be cleaned up.'),
+    ),
     'view dev helps' => array(
       'title' => t('View Developer Hints'),
       'description' => t('Tripal will provide blue shaded boxes that provide