As @parth115  says, you should create a function that checks if user is a moderator.