     @on 'CollaborationNotInitialized', => @everyone.destroySubViews()
     @on 'ParticipantJoined', @bound 'addParticipant'
     @on 'ParticipantLeft',   @bound 'removeParticipant'
-    @on 'PermissionChanged', @bound 'handlePermissionChange'
 
     @on 'CollaborationEnded', =>
       @toggleButtons 'ended'


    remote.cacheable nickname, (err, account) =>
      @createParticipantView account.first, yes


  updateDefaultPermissions: ->

    permissions = @rtm.getFromModel 'permissions'
    @defaultPermission.setValue permissions.get 'default'


  setDefaultPermission: (value) ->

    @rtm.getFromModel('permissions').set 'default', value


  handlePermissionChange: (event) ->

    {newValue, property} = event

    return  unless newValue in ['edit', 'read']

    if property is 'default'
      @defaultPermission.setValue newValue
    else
      @participantViews[property]?.permissions.setValue newValue


  viewAppended: JView::viewAppended

    @everyone.addSubView participantView, null, isOnline
    @onboarding?.destroy()


  removeParticipant: (username, unshare) ->

