code: def check_perms(perms, user, slug, raise_exception=False):
      
      if isinstance(perms, string_types):
          perms = {perms}
      else:
          perms = set(perms)
  
      allowed_users = ACLRule.get_users_for(perms, slug)
  
      if allowed_users:
          return user in allowed_users
  
      if perms.issubset(set(WALIKI_ANONYMOUS_USER_PERMISSIONS)):
          return True
  
      if is_authenticated(user) and perms.issubset(set(WALIKI_LOGGED_USER_PERMISSIONS)):
          return True
  
      # First check if the user has the permission (even anon users)
      if user.has_perms(['waliki.%s' % p for p in perms]):
          return True
      # In case the 403 handler should be called raise the exception
      if raise_exception:
          raise PermissionDenied
      # As the last resort, show the login form
      return False
docs: a helper user to check if a user has the permissions
      for a given slug