1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
2 | ;; Field Permissions module |
---|
3 | ;; |
---|
4 | ;; Original author: markus_petrux (http://drupal.org/user/39593) |
---|
5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
6 | |
---|
7 | CONTENTS OF THIS FILE |
---|
8 | ===================== |
---|
9 | * OVERVIEW |
---|
10 | * USAGE |
---|
11 | * REQUIREMENTS |
---|
12 | * INSTALLATION |
---|
13 | * UPGRADING FROM CCK CONTENT PERMISSIONS |
---|
14 | |
---|
15 | |
---|
16 | OVERVIEW |
---|
17 | ======== |
---|
18 | |
---|
19 | The Field Permissions module is a drop-in replacement for the Content |
---|
20 | Permissions module shipped with CCK. |
---|
21 | |
---|
22 | The key differences are: |
---|
23 | |
---|
24 | * It allows site administrators to set field-level permissions to edit or |
---|
25 | view CCK fields in any node, and optionally (new feature compared to |
---|
26 | Content Permissions), edit or view permissions for nodes owned by the |
---|
27 | current user. |
---|
28 | |
---|
29 | * Permissions for each field are not created by default. Instead, |
---|
30 | administrators can enable these permissions explicitly for the fields |
---|
31 | where this feature is needed. |
---|
32 | |
---|
33 | |
---|
34 | USAGE |
---|
35 | ===== |
---|
36 | |
---|
37 | Once Field Permissions module is installed, you need to edit the field settings |
---|
38 | form to enable permissions for each where you need this feature. You can enable |
---|
39 | any of the following permission types: |
---|
40 | |
---|
41 | * Create FIELD (edit on node creation). |
---|
42 | * Edit any FIELD, regardless of its node author. |
---|
43 | * Edit own FIELD on node created by the user. |
---|
44 | * View any FIELD, regardless of its node author. |
---|
45 | * View own FIELD on node created by the user. |
---|
46 | |
---|
47 | Use these options to enable role based permissions for this field. When |
---|
48 | permissions are enabled, access to this field is denied by default and explicit |
---|
49 | permissions should be granted to the proper user roles from the permissions |
---|
50 | administration page. On the other hand, when these options are disabled, field |
---|
51 | permissions are inherited from node view and/or edit permissions. In example, |
---|
52 | users allowed to view a particular node will also be able to view this field, |
---|
53 | and so on. |
---|
54 | |
---|
55 | |
---|
56 | REQUIREMENTS |
---|
57 | ============ |
---|
58 | |
---|
59 | - CCK (6.x-2.5 or higher). |
---|
60 | http://drupal.org/project/cck |
---|
61 | |
---|
62 | Field permissions requires that hook_field_access() is invoked with $account |
---|
63 | as 3rd argument (added to CCK in 6.x-2.2, see [#336174] [1]) and $node as 4th |
---|
64 | argument (added to CCK in 6.x-2.5, see [#514452] [2]). |
---|
65 | |
---|
66 | [1] http://drupal.org/node/336174 |
---|
67 | [2] http://drupal.org/node/514452 |
---|
68 | |
---|
69 | |
---|
70 | INSTALLATION |
---|
71 | ============ |
---|
72 | |
---|
73 | - Be sure to install all dependent modules. |
---|
74 | |
---|
75 | - Copy all contents of this package to your modules directory preserving |
---|
76 | subdirectory structure. |
---|
77 | |
---|
78 | - Go to Administer -> Site building -> Modules to install module. |
---|
79 | |
---|
80 | - Review the settings of your fields. You will find a new option labelled |
---|
81 | "Field permissions" that allows you to enable permissions per field. It |
---|
82 | is disabled by default. |
---|
83 | |
---|
84 | |
---|
85 | UPGRADING FROM CCK CONTENT PERMISSIONS |
---|
86 | ====================================== |
---|
87 | |
---|
88 | The Field Permissions module is fully compatible with the permissions already |
---|
89 | defined with Content Permissions module shipped with CCK. |
---|
90 | |
---|
91 | 1. Make backups to ensure you can easily fallback in case of any trouble. |
---|
92 | 2. Install Field Permissions module while Content Permissions module is |
---|
93 | still enabled. |
---|
94 | 3. Disable and then Uninstall Content Permissions module. |
---|
95 | 4. You can now check your existing permissions are still there, in the |
---|
96 | Permissions administration screen. |
---|
97 | 5. Now, you may wish to disable permissions for fields where this feature |
---|
98 | is not really needed. |
---|