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

Revision as of 20:19, 14 April 2010 by Cfremon (talk | contribs) (Adding Article Infobox)

Admin Article

Article Information

This article applies to the following ZCS versions.

ZCS 6.0 Article ZCS 6.0 ZCS 5.0 Article ZCS 5.0 ZCS 4.5 Article ZCS 4.5

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;


Related Articles



Verified Against: unknown 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: 2010-04-14



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