<commit_before>class Ability
  include CanCan::Ability

  # Follows CanCanCan best practices for granting permissions.
  #
  # @see https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities%3A-Best-Practices#give-permissions-dont-take-them-away
  #
  def initialize(user)
    if user.persisted? && user.class == AdminUser
      return unless user.role&.board_accessible?
      can :read, ActiveAdmin::Page, name: 'Dashboard', namespace_name: 'admin'
      can :read, CodeSchool
      can :read, Location
      can :read, User
      can [:read, :update], AdminUser, id: user.id

      return unless user.role&.admin_accessible?
      can :read, :all
      can :manage, CodeSchool
      can :manage, Location
      can :manage, User

      return unless user.role&.super_admin?
      can :manage, :all
    end
  end<commit_msg>Updates permissions with TeamMember<commit_after>class Ability
  include CanCan::Ability

  # Follows CanCanCan best practices for granting permissions.
  #
  # @see https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities%3A-Best-Practices#give-permissions-dont-take-them-away
  #
  def initialize(user)
    if user.persisted? && user.class == AdminUser
      return unless user.role&.board_accessible?
      can :read, ActiveAdmin::Page, name: 'Dashboard', namespace_name: 'admin'
      can :read, CodeSchool
      can :read, Location
      can :read, TeamMember
      can :read, User
      can [:read, :update], AdminUser, id: user.id

      return unless user.role&.admin_accessible?
      can :read, :all
      can :manage, CodeSchool
      can :manage, Location
      can :manage, TeamMember
      can :manage, User

      return unless user.role&.super_admin?
      can :manage, :all
    end
  end
{'fraction_non_alphanumeric': 0.10388127853881278, 'fraction_numerical': 0.001141552511415525, 'mean_word_length': 3.154028436018957, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '770667', 'n_tokens_mistral': 569, 'n_tokens_neox': 539, 'n_words': 142}