Add the user groups mechanism.

Signed-off-by: Xie Haozhe <zjhzxhz@gmail.com>