add username utility; add resource permission check