<commit_before>Review.PermissionCellComponent = Ember.Component.extend
  tagName: 'th'
  classNames: ['permissions', 'text-center']
  classNameBindings: ['permission.isAllowed:success:danger']

  permission: (() ->
    user = @get('user')
    project = @get('project')
    permission = user.get('permissions').find((item) -> item.get('project.id') == project.get('id'))
    permission ||= @createPermission(user, project)
  ).property('project', 'user')

  createPermission: (user, project) ->
    permission = Review.Permission.createRecord({
        allowed: false
        user: user
        project: project
      })

  actions:
    grantAccess: (permission)->
      permission.set('allowed', true)
      permission.get('store').commit()

    revokeAccess: (permission)->
      permission.set('allowed', false)
      permission.get('store').commit()<commit_msg>added target object store to component [#94482058]<commit_after>Review.PermissionCellComponent = Ember.Component.extend
  tagName: 'th'
  classNames: ['permissions', 'text-center']
  classNameBindings: ['permission.isAllowed:success:danger']
  store = this.get('targetObject.store')

  permission: (() ->
    user = @get('user')
    project = @get('project')
    permission = user.get('permissions').find((item) -> item.get('project.id') == project.get('id'))
    permission ||= @createPermission(user, project)
  ).property('project', 'user')

  createPermission: (user, project) ->
    permission = @store.createRecord({
        allowed: false
        user: user
        project: project
      })

  actions:
    grantAccess: (permission)->
      permission.set('allowed', true)
      permission.get('store').commit()

    revokeAccess: (permission)->
      permission.set('allowed', false)
      permission.get('store').commit()
{'fraction_non_alphanumeric': 0.1637883008356546, 'fraction_numerical': 0.004456824512534819, 'mean_word_length': 3.8150134048257374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2654222', 'n_tokens_mistral': 514, 'n_tokens_neox': 500, 'n_words': 97}