1 | # PURPOSE |
---|
2 | |
---|
3 | This format is used to describe advance ACL for Piwigo installation. |
---|
4 | This ACL is supported by the plugin `icy_picture_modify`. |
---|
5 | |
---|
6 | # FORMAT |
---|
7 | |
---|
8 | Format details |
---|
9 | |
---|
10 | * Name: ZAML (not YAML) |
---|
11 | * Version: 1.0.0 |
---|
12 | * Author: icy (Anh K. Huynh) |
---|
13 | |
---|
14 | # SYNTAX |
---|
15 | |
---|
16 | There are only three types of lines in the format. They follows |
---|
17 | a rule: a late one overwrites any similar mean of the previous lines. |
---|
18 | |
---|
19 | * user name specification _(meanful)_ |
---|
20 | * variable assigment _(meanful)_ |
---|
21 | * all other non-sense lines _(meanless)_ |
---|
22 | |
---|
23 | ## User name specification |
---|
24 | |
---|
25 | A user name (as in your Piwigo system) is put on a single line, |
---|
26 | ended by a colon (:), and optionally followed by `reference`. |
---|
27 | |
---|
28 | A `reference` is any user name started by `@`. The current user |
---|
29 | will have all settings of the `reference` user; those settings will |
---|
30 | be overwritten by other assignment for the current user. If the |
---|
31 | `reference` user has't any settings at the time it is declared, |
---|
32 | the reference will be ignored. |
---|
33 | |
---|
34 | * *Note 1:* The special name `default` is used specially by the format, |
---|
35 | and you should not use it for any user in your Piwigo system. |
---|
36 | * *Note 2:* User name must not contain a colon (:) |
---|
37 | |
---|
38 | ## Variable assigment |
---|
39 | |
---|
40 | A variable assigment has two parts: a variable name and its value. |
---|
41 | On the line, the variable name must be started by two spaces, |
---|
42 | followed by a colon (:) and its value. |
---|
43 | |
---|
44 | You can specify any variable name, though most of them are not |
---|
45 | officialy supported by `icy_picture_modify` (see EXAMPLES). |
---|
46 | |
---|
47 | To specify variable's value, you can use |
---|
48 | |
---|
49 | * nothing, or any spaces _(meaning: `FALSE`)_ |
---|
50 | * `no`, `false` _(meaning: `FALSE`)_ |
---|
51 | * `yes`, `true` _(meaning: `TRUE`)_ |
---|
52 | * Any other string. This string will be considered as an array |
---|
53 | whose its delimiter is any space, semi-colon (`;`), colon (`:`) |
---|
54 | or colon (`,`), or any combination of them. Each item of array |
---|
55 | is often a number, a user name, `sub` or `any` or `owner`. |
---|
56 | |
---|
57 | * number: specify category identity |
---|
58 | * user name: specify any Piwigo user name |
---|
59 | * `sub`: action can work on sub categories |
---|
60 | * `any`: action can work on any categories |
---|
61 | * `owner`: action can work on any image of current user |
---|
62 | |
---|
63 | ## Meanless lines |
---|
64 | |
---|
65 | Any other lines are considered as comment. They are meanless. |
---|
66 | |
---|
67 | # PARSER |
---|
68 | |
---|
69 | Simple parser can be found in the function `icy_zml_parser` in |
---|
70 | ``` |
---|
71 | plugins/icy_picture_modify/include/ \ |
---|
72 | functions_icy_picture_modify.inc.php |
---|
73 | ``` |
---|
74 | |
---|
75 | # EXAMPLE |
---|
76 | |
---|
77 | ## Default settings |
---|
78 | |
---|
79 | Default settings for all users (except guest user). These settings are |
---|
80 | put in the code of the plugin `icy_picture_modify` so you may not have |
---|
81 | to specify them. All of the following lines mean: |
---|
82 | |
---|
83 | * User can edit their own images (image they uploaded) |
---|
84 | * User can't delete any image |
---|
85 | * User can upload image to sub categories. Unfortunately, there is no |
---|
86 | * category specified, so they can't upload images to any category. |
---|
87 | * All images are showed on the Piwigo system after they are uploaded; |
---|
88 | * they will not require any moderation work |
---|
89 | * User can create new gallery inside sub categories. As there isn't |
---|
90 | * any category specified, they can't create any new gallery. |
---|
91 | * User can't link an image to any album |
---|
92 | * User can't create representation for any album |
---|
93 | |
---|
94 | ``` |
---|
95 | default: |
---|
96 | edit_image_of: owner |
---|
97 | delete_image_of: |
---|
98 | upload_image_to: sub |
---|
99 | moderate_image: no |
---|
100 | create_gallery_to: sub |
---|
101 | associate_image_to: |
---|
102 | present_image_to: |
---|
103 | ``` |
---|
104 | |
---|
105 | ## A normal user |
---|
106 | |
---|
107 | This user can upload image to category whose identity is `34`; |
---|
108 | He can edit image of his own and of the user `example_user0`; |
---|
109 | He can link images to any album in Piwigo system; |
---|
110 | He can create new gallery in the parent category `34` and its sub |
---|
111 | category; He can also make representation for any album |
---|
112 | Finally, he can't delete any images. |
---|
113 | |
---|
114 | ``` |
---|
115 | example_user1: |
---|
116 | upload_image_to: sub, 34 |
---|
117 | edit_image_of: example_user0, owner |
---|
118 | associate_image_to: any |
---|
119 | create_gallery_to: 34, sub |
---|
120 | present_image_to: any |
---|
121 | delete_image_of: |
---|
122 | ``` |
---|
123 | |
---|
124 | ## Reference |
---|
125 | |
---|
126 | This user `example_user2` will have all settings of `example_user1`, |
---|
127 | except he can delete images of `example_user1` and his own |
---|
128 | |
---|
129 | ``` |
---|
130 | example_user2: @example_user1 |
---|
131 | delete_image_of: owner, example_user1 |
---|
132 | ``` |
---|