Clearing the "don't inherit grants from parent folder"(i) flag: Difference between revisions

(Adding Article Infobox)
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Article Infobox|{{admin}}|{{ZCS 6.0}}|{{ZCS 5.0}}|{{ZCS 4.5}}}}=Description=
{{BC|Community Sandbox}}
__FORCETOC__
<div class="col-md-12 ibox-content">
=Clearing the "don't inherit grants from parent folder" (i) flag=
{{KB|{{Unsupported}}|{{ZCS 7.0}}|{{ZCS 6.0}}|}}
{{WIP}}
=Description=
If you have already shared and revoked permissions for a folder, you may experience problems sharing it again.  The following steps will clear the "don't inherit grants from parent folder" (i) flag.  To correct this problem, follow the steps below.
If you have already shared and revoked permissions for a folder, you may experience problems sharing it again.  The following steps will clear the "don't inherit grants from parent folder" (i) flag.  To correct this problem, follow the steps below.


Line 79: Line 85:
(from dsacchet)
(from dsacchet)


<pre>
  #!/bin/bash
  #!/bin/bash
   
   
Line 120: Line 127:
  echo "<-------------------------------------------->"
  echo "<-------------------------------------------->"
  done;
  done;
</pre>


The script above is very slow due to the repeated calls to zmmailbox, the one below is less sophisticated but also a lot faster.
<pre>
zmmailbox -z -m $account gf / | awk -F : '/^ *[{]/ { f=""; next } /"flags": *".*i.*"/{ f=$2; sub(/i/, "", f); next } /"ownerId":/ { f=""; next } /"path":/ { if (f != "") { x="modifyFolderFlags "$2" "f; gsub(/",/, "\"", x); print x } }' | zmmailbox -z -m $account -f /dev/stdin
</pre>


=Related Articles=
=Related Articles=
Line 128: Line 141:




{{Article Footer|unknown|1/11/2010}}
{{Article Footer|Zimbra Collaboration 7.0, 6.0|1/11/2010}}


[[Category:Administration]]
[[Category:Administration]]
[[Category:Sharing]]
[[Category:Sharing]]
[[Category:Troubleshooting]]
[[Category:Troubleshooting]]
[[Category:ZCS 7.0]]
[[Category:ZCS 6.0]]
[[Category:ZCS 6.0]]
[[Category:ZCS 5.0]]
[[Category:ZCS 5.0]]
[[Category:ZCS 4.5]]

Latest revision as of 15:46, 11 July 2015

Clearing the "don't inherit grants from parent folder" (i) flag

   KB 3293        Last updated on 2015-07-11  




0.00
(0 votes)

Description

If you have already shared and revoked permissions for a folder, you may experience problems sharing it again. The following steps will clear the "don't inherit grants from parent folder" (i) flag. To correct this problem, follow the steps below.

How to clear the i flag

The "don't inherit grants from parent folder"(i) flag can be cleared by the "zmmailbox mff" command, as follows:

1. Find out and remember the currently set flags:

zmmailbox -z -m {user-name} gf {folder-path}
e.g.
>zmmailbox -z -m user1@test.com gf /Inbox
{
    "color": "defaultColor",
    "contentSequence": 1,
    "defaultView": "message",
    "flags": "ui",
    "grants": [],
    "id": "2",
    "isCheckedInUI": false,
    "isExcludedFromFreeBusy": false,
    "isSyncEnabled": false,
    "isSyncFolder": false,
    "isSystemFolder": true,
    "itemCount": 222,
    "name": "Inbox",
    "parentId": "1",
    "path": "/Inbox",
    "pathURLEncoded": "/Inbox",
    "size": 7592687,
    "subFolders": [],
    "unreadCount": 222
}


The current flags are "ui" in the example.


2. Remove only the i (no inherit) flag and preserve all other flags:

zmmailbox -z -m {user-name} mff {folder-path} {flags}

Continuing with the example in step 1, e.g.

zmmailbox -z -m user1@test.com mff /Inbox u


3. Check that it is updated as expected. The 'i' flag should be gone and all other flags should be still present.

e.g.

>zmmailbox -z -m user1@test.com gf /Inbox
{
    "color": "defaultColor",
    "contentSequence": 1,
    "defaultView": "message",
    "flags": "u",
    "grants": [],
    "id": "2",
    "isCheckedInUI": false,
    "isExcludedFromFreeBusy": false,
    "isSyncEnabled": false,
    "isSyncFolder": false,
    "isSystemFolder": true,
    "itemCount": 222,
    "name": "Inbox",
    "parentId": "1",
    "path": "/Inbox",
    "pathURLEncoded": "/Inbox",
    "size": 7592687,
    "subFolders": [],
    "unreadCount": 222
}

Automated script

(from dsacchet)

 #!/bin/bash
 
 account=$1
 
 if [ x"$(id -n -u)" != x"zimbra" ]
 then
 	echo "Ce script doit etre lance sous l'utilisateur zimbra"
 	exit 1
 fi
 
 zmprov ga "$1" &> /dev/null
 
 if [ $? -ne 0 ]
 then
 	echo "Le compte $account n'existe pas !"
 	exit 1
 fi
 
 zmmailbox -z -m "$account" gaf | sed "1,2d" | cut -d "/" -f "2-" | while read folder
 do
 	echo "On traite le dossier '/$folder'"
 	oldflags=$(zmmailbox -z -m "$account" gf "/$folder" | grep flags | head -n 1 | cut -d ":" -f 2 | sed 's@[^"]*"\([^"]*\)".*@\1@')
 	echo " ** old flags : '$oldflags'"
 	newflags=$(echo "$oldflags" | sed 's@i@@g')
 	echo " ** new flags : '$newflags'"
 
 	if [ x"$oldflags" != x"$newflags" ]
 	then
 		echo "=> On essaye d'appliquer les nouveaux flags"
 		zmmailbox -z -m "$account" mff "/$folder" "$newflags"
 		if [ $? -eq 0 ]
 		then
 			echo "** Nouveaux flags appliques avec succes"
 		else
 			echo "** Nouveau flags non appliques"
 		fi
 	else
 		echo "=> Rien a faire"
 	fi
 	echo "<-------------------------------------------->"
 done;

The script above is very slow due to the repeated calls to zmmailbox, the one below is less sophisticated but also a lot faster.

zmmailbox -z -m $account gf / | awk -F : '/^ *[{]/ { f=""; next } /"flags": *".*i.*"/{ f=$2; sub(/i/, "", f); next } /"ownerId":/ { f=""; next } /"path":/ { if (f != "") { x="modifyFolderFlags "$2" "f; gsub(/",/, "\"", x); print x } }' | zmmailbox -z -m $account -f /dev/stdin

Related Articles



Verified Against: Zimbra Collaboration 7.0, 6.0 Date Created: 1/11/2010
Article ID: https://wiki.zimbra.com/index.php?title=Clearing_the_%22don%27t_inherit_grants_from_parent_folder%22(i)_flag Date Modified: 2015-07-11



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search