Browse Source

add field permission page

bradfordcondon 6 năm trước cách đây
mục cha
commit
fd96b6a9b5

+ 1 - 0
docs/dev_guide.rst

@@ -12,6 +12,7 @@ Developer's Guide
    dev_guide/chado
    dev_guide/custom_modules
    dev_guide/custom_field
+   dev_guide/field_permissions
    dev_guide/custom_data_loader
    dev_guide/custom_web_services
    dev_guide/tutorials

BIN
docs/dev_guide/field_permissions.1.cross_ref_GA.png


BIN
docs/dev_guide/field_permissions.2.crossref_permissions.png


+ 50 - 0
docs/dev_guide/field_permissions.rst

@@ -0,0 +1,50 @@
+Field Specific Permissions
+===========================
+
+
+.. _why_field_permissions:
+
+Why Field Permissions?
+----------------------
+
+Not all Tripal Fields are created equal.  You may have some fields that you dont want all users to be able to view, or even to be able to edit.    This might be the case for a variety of reasons.  Some Chado base tables may have **type** fields that you don't utilize: for example, the contact table.  Some of your bundles may be configured with a lot of property fields, with only a subset of them being relevant to an end user submitting data via HQ.  Some fields are just not intuitive without some Chado experience: for example, the Cross-Reference field.
+
+Simply disabling the display of the formatter won't prevent the widget from showing up on the submission page, and besides, you might want site admins to still have access to those fields!  Deleting the field will cause them to re-appear when you press the "Check for New Fields" button!  Field Permissions allows you to configure field-specific permissions so that users contributing content via Chado only see the fields they need to see.
+
+Installing the Drupal Field Permissions module
+--------------------------------------------
+
+The module can be enabled directly from Drush with the below command.
+
+.. code-block:: bash
+
+  drush pm-enable -y field_permissions
+
+
+You can find the Field Permission module page here: https://www.drupal.org/project/field_permissions and a more in-depth user guide here: https://www.drupal.org/node/2802067
+
+
+
+Setting Field-specific Permissions
+--------------------------------------------
+
+
+
+Let's assume I want to hide the Cross-Reference field from my users submitting Genome Assembly data, but still want it available for my administrators.
+
+.. image:: /_static/img/field_permissions.1.cross_ref_GA.png
+
+First, navigate to the bundle field configuration page via **Admin --> Structure --> Tripal Content --> Genome Assembly**.  For each field we want to hide, we must configure the field instance settings individually.  Click **Edit** for the Cross Reference field, and scroll down to **CROSS REFERENCE FIELD SETTINGS**.
+Select **Custom Permissions** and ensure that the user role you set up for HQ submitters can view, but cannot edit, this field.
+
+.. image:: /_static/img/field_permissions.2.crossref_permissions.png
+
+Once permissions are configured to your liking, click **Save Settings**.
+
+
+.. warning::
+
+  Some fields are **Required**.  Do not disable required fields that can't be null.  If you do, users won't be able to submit content!
+
+
+Now, if you submit content via Tripal HQ as a user with that role, the field will not display on the widgets, but will still appear on normal content.