Added permission check for integtrations plugins.
This commit is contained in:
parent
725f21337d
commit
1ef49c9e1b
6 changed files with 17 additions and 3 deletions
|
@ -157,6 +157,7 @@ App.Config.set(
|
|||
description: 'A powerfull service to get more information about your customers.'
|
||||
controller: Index
|
||||
state: State
|
||||
permission: ['admin.integration.clearbit']
|
||||
}
|
||||
'NavBarIntegrations'
|
||||
)
|
||||
|
|
|
@ -535,6 +535,7 @@ App.Config.set(
|
|||
description: 'Exchange integration for contacts management.'
|
||||
controller: Index
|
||||
state: State
|
||||
permission: ['admin.integration.exchange']
|
||||
}
|
||||
'NavBarIntegrations'
|
||||
)
|
||||
|
|
|
@ -26,6 +26,7 @@ App.Config.set(
|
|||
description: 'An open source monitoring tool.'
|
||||
controller: Index
|
||||
state: State
|
||||
permission: ['admin.integration.icinga']
|
||||
}
|
||||
'NavBarIntegrations'
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ class Index extends App.ControllerIntegrationBase
|
|||
featureName: 'i-doit'
|
||||
featureConfig: 'idoit_config'
|
||||
description: [
|
||||
['This service allows you to connect i-doit objects with Zammad.']
|
||||
['This service allows you to connect %s with %s.', 'i-doit', 'Zammad']
|
||||
]
|
||||
events:
|
||||
'change .js-switch input': 'switch'
|
||||
|
|
|
@ -587,6 +587,7 @@ App.Config.set(
|
|||
description: 'LDAP integration for user management.'
|
||||
controller: Index
|
||||
state: State
|
||||
permission: ['admin.integration.ldap']
|
||||
}
|
||||
'NavBarIntegrations'
|
||||
)
|
||||
|
|
|
@ -33,11 +33,21 @@ class Index extends App.ControllerSubContent
|
|||
render: =>
|
||||
return if @initRender && @integration
|
||||
|
||||
@user = App.User.find(App.Session.get('id'))
|
||||
|
||||
@initRender = true
|
||||
integrations = []
|
||||
for key, value of @integrationItems
|
||||
value.key = key
|
||||
integrations.push value
|
||||
if !value.permission
|
||||
value.key = key
|
||||
integrations.push value
|
||||
else
|
||||
match = false
|
||||
for permissionName in value.permission
|
||||
if !match && @user.permission(permissionName)
|
||||
match = true
|
||||
value.key = key
|
||||
integrations.push value
|
||||
integrations = _.sortBy(integrations, (item) -> return item.name)
|
||||
@html App.view('integration/index')(
|
||||
head: 'Integrations'
|
||||
|
|
Loading…
Reference in a new issue