def check_addon_ownership(request, addon, viewer=False, dev=False, support=False, admin=True, ignore_disabled=False):
 if (not request.user.is_authenticated()):
  return False
 if addon.is_deleted:
  return False
 if (admin and action_allowed(request, 'Addons', 'Edit')):
  return True
 if ((addon.status == amo.STATUS_DISABLED) and (not ignore_disabled)):
  return False
 roles = (amo.AUTHOR_ROLE_OWNER,)
 if dev:
  roles += (amo.AUTHOR_ROLE_DEV,)
 elif viewer:
  roles += (amo.AUTHOR_ROLE_DEV, amo.AUTHOR_ROLE_VIEWER, amo.AUTHOR_ROLE_SUPPORT)
 elif support:
  roles += (amo.AUTHOR_ROLE_SUPPORT,)
 return addon.authors.filter(pk=request.user.pk, addonuser__role__in=roles).exists()

def check_addon_ownership ( request , addon , viewer = False , dev = False , support = False , admin = True , ignore_disabled = False ) : if ( not request . user . is_authenticated ( ) ) : return False if addon . is_deleted : return False if ( admin and action_allowed ( request , 'Addons' , 'Edit' ) ) : return True if ( ( addon . status == amo . STATUS_DISABLED ) and ( not ignore_disabled ) ) : return False roles = ( amo . AUTHOR_ROLE_OWNER , ) if dev : roles += ( amo . AUTHOR_ROLE_DEV , ) elif viewer : roles += ( amo . AUTHOR_ROLE_DEV , amo . AUTHOR_ROLE_VIEWER , amo . AUTHOR_ROLE_SUPPORT ) elif support : roles += ( amo . AUTHOR_ROLE_SUPPORT , ) return addon . authors . filter ( pk = request . user . pk , addonuser__role__in = roles ) . exists ( )
check request .