Sha256: 1f641ac375bf8c80e1af53cad5148862a2c5cff9259d4b1639a3e4b9e5d2da9b

Contents?: true

Size: 875 Bytes

Versions: 8

Compression:

Stored size: 875 Bytes

Contents

class Lanes.Access.Extension extends Lanes.Extensions.Base

    identifier: "lanes-access"

    setBootstrapData: (data) ->
        Lanes.Models.Role.all = new Lanes.Models.Role.Collection( data.roles )
        Lanes.current_user = new Lanes.Models.User
        if data.user
            Lanes.current_user.set(data.user)
        if data.access
            Lanes.current_user.access_data = data.access

    showLogin: ->
        Lanes.Access.LoginDialog.instance().show(@viewport)

    hideLogin: ->
        Lanes.Workspace.Extension.uistate.modalDialog = null

    onAvailable: (viewport) ->
        @viewport = viewport
        Lanes.current_user.on('change:isLoggedIn', =>
            if Lanes.current_user.isLoggedIn
                @hideLogin()
            else
                @showLogin()
        )
        unless Lanes.current_user.isLoggedIn
            @showLogin()

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lanes-0.7.0 client/lanes/access/Extension.coffee
lanes-0.6.1 client/lanes/access/Extension.coffee
lanes-0.6.0 client/lanes/access/Extension.coffee
lanes-0.5.6 client/lanes/access/Extension.coffee
lanes-0.5.5 client/lanes/access/Extension.coffee
lanes-0.5.0 client/lanes/access/Extension.coffee
lanes-0.4.0 client/lanes/access/Extension.coffee
lanes-0.3.0 client/lanes/access/Extension.coffee