fix data nil error
show edit dialog only when user has permission