Add support of permissions for groups.

Change-Id: Id5338b74152e2e85ce8b6de06286ae5a96b8ddc8