<commit_before>class Api::V1::MembersController < Api::V1::ApiController
  skip_before_action :authenticate_member!, only: [:create]

  def index
    @members = current_site.website_members
  end

  def create
    member = Member.find_by_email(website_member[:email])
    if params[:website_member]['token'].present?
      WebsiteMember.find_by_invitation_token(website_member[:token]).update_attributes(:member_id => member.id)
    end
  end

  def show
    @member = current_member
  end

  def destroy
    @website_member = WebsiteMember.find(params[:id])
    _not_allowed!("Owner can't be removed!") if @website_member.role == 'owner'
    @website_member.destroy()<commit_msg>require owner access to remove member<commit_after>class Api::V1::MembersController < Api::V1::ApiController
  skip_before_action :authenticate_member!, only: [:create]

  def index
    @members = current_site.website_members
  end

  def create
    member = Member.find_by_email(website_member[:email])
    if params[:website_member]['token'].present?
      WebsiteMember.find_by_invitation_token(website_member[:token]).update_attributes(:member_id => member.id)
    end
  end

  def show
    @member = current_member
  end

  def destroy
    record = WebsiteMember.find(params[:id]).website.website_members.where('member_id=?', current_member.id)
    if record.present?
      _not_allowed!("Owner access required!") if record[0].role == 'user'
      @website_member = WebsiteMember.find(params[:id])
      _not_allowed!("Owner can't be removed!") if @website_member.role == 'owner'
      @website_member.destroy()
    end
{'fraction_non_alphanumeric': 0.11783042394014963, 'fraction_numerical': 0.003117206982543641, 'mean_word_length': 4.836363636363636, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3822817', 'n_tokens_mistral': 509, 'n_tokens_neox': 485, 'n_words': 94}