created methods for type check in permissions and roles methods
improved type check for permissions and roles methods