Fix ssh-keys:add permission error

This commit is contained in:
Justin Clark
2016-08-12 16:01:05 -07:00
parent 3651e56ca5
commit 98ec2979ea
2 changed files with 5 additions and 5 deletions

View File

@@ -3,11 +3,11 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
check_ssh_keys_user() {
declare desc="check user running ssh-keys"
declare desc="check user passed by user-auth for ssh-keys plugin"
local SSH_USER=$1 SSH_NAME=$2
[[ "$SSH_USER" == "root" || "$SSH_NAME" == *admin* ]] || dokku_log_fail "You must be root, or a dokku admin, to execute this command"
}
if [[ "$3" == ssh-keys* ]]; then
if [[ "$3" =~ (ssh-keys:add|ssh-keys:remove) ]]; then
check_ssh_keys_user "$@"
fi