Fixed user permission bugs