Commit 37fe3f84ac350c54c32369e3a044eae45400e983
1 parent
031467c4
Exists in
master
and in
28 other branches
Check for the required permissions
Showing
1 changed file
with
11 additions
and
0 deletions
Show diff stats
script/noosfero-plugins
@@ -155,6 +155,17 @@ if [ -z "$command" ]; then | @@ -155,6 +155,17 @@ if [ -z "$command" ]; then | ||
155 | exit 1 | 155 | exit 1 |
156 | fi | 156 | fi |
157 | shift | 157 | shift |
158 | + | ||
159 | + | ||
160 | +case "$command" in | ||
161 | + enableall|disableall|enable|disable|new) | ||
162 | + if [ ! -w "$enabled_plugins_dir" ]; then | ||
163 | + echo "E: sorry, you don't have the required permissions to manage plugins" | ||
164 | + exit 2 | ||
165 | + fi | ||
166 | + ;; | ||
167 | +esac | ||
168 | + | ||
158 | case "$command" in | 169 | case "$command" in |
159 | list|status|usage|enableall|disableall) | 170 | list|status|usage|enableall|disableall) |
160 | if [ ! -z "$1" ]; then | 171 | if [ ! -z "$1" ]; then |