mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
ask confirmation to grant SSH/SFTP permissions to a group
This commit is contained in:
parent
fc5f20b442
commit
87a5c12b54
3 changed files with 10 additions and 2 deletions
|
@ -91,8 +91,9 @@
|
|||
"confirm_app_default": "Are you sure you want to make this app default?",
|
||||
"confirm_change_maindomain": "Are you sure you want to change the main domain?",
|
||||
"confirm_delete": "Are you sure you want to delete {name}?",
|
||||
"confirm_firewall_allow": "Are you sure you want to open port {port} (protocol: {protocol}, connection: {connection})",
|
||||
"confirm_firewall_allow": "dAre you sure you want to open port {port} (protocol: {protocol}, connection: {connection})",
|
||||
"confirm_firewall_disallow": "Are you sure you want to close port {port} (protocol: {protocol}, connection: {connection})",
|
||||
"confirm_group_add_access_permission": "Are you sure you want to grant a {perm} access to your server to {name}'?",
|
||||
"confirm_install_custom_app": "WARNING! Installing 3rd party applications may compromise the integrity and security of your system. You should probably NOT install it unless you know what you are doing. Are you willing to take that risk?",
|
||||
"confirm_install_domain_root": "Are you sure you want to install this application on '/'? You will not be able to install any other app on {domain}",
|
||||
"confirm_app_install": "Are you sure you want to install this application?",
|
||||
|
|
|
@ -199,8 +199,14 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
onPermissionChanged ({ option, groupName, action, applyMethod }) {
|
||||
async onPermissionChanged ({ option, groupName, action, applyMethod }) {
|
||||
const permId = this.permissions.find(perm => perm.label === option).id
|
||||
if (action === 'add' && ['sftp.main', 'ssh.main'].includes(permId)) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_group_add_access_permission', { name: groupName, perm: option })
|
||||
)
|
||||
if (!confirmed) return
|
||||
}
|
||||
api.put(
|
||||
// FIXME hacky way to update the store
|
||||
{ uri: `users/permissions/${permId}/${action}/${groupName}`, storeKey: 'permissions', groupName, action, permId },
|
||||
|
|
|
@ -185,6 +185,7 @@ export default {
|
|||
}
|
||||
|
||||
const actionTrad = this.$i18n.t({ allow: 'open', disallow: 'close' }[action])
|
||||
console.log(action, actionTrad)
|
||||
return api.put(
|
||||
`firewall/${protocol}/${action}/${port}?${connection}_only`,
|
||||
{},
|
||||
|
|
Loading…
Reference in a new issue