code: def check_permission(permission, obj):
      
      mtool = api.get_tool('portal_membership')
      object = api.get_object(obj)
      return mtool.checkPermission(permission, object)
docs: Returns if the current user has rights for the permission passed in against
      the obj passed in
      :param permission: name of the permission
      :param obj: the object to check the permission against for the current user
      :return: 1 if the user has rights for this permission for the passed in obj