Fix a bug that permissions are not handled correctly in Analytics plugin