added a predicate in checking for permissions