dont show user provided auth as option for personal mounts

This commit is contained in:
Robin Appelman 2016-01-19 14:21:59 +01:00
parent 860d51487b
commit 5bdcd534b1
3 changed files with 5 additions and 3 deletions

View File

@ -836,8 +836,9 @@ MountConfigListView.prototype = _.extend({
$tr.find('.backend').data('identifier', backend.identifier);
var selectAuthMechanism = $('<select class="selectAuthMechanism"></select>');
var neededVisibility = (this._isPersonal) ? 1 : 2;
$.each(this._allAuthMechanisms, function(authIdentifier, authMechanism) {
if (backend.authSchemes[authMechanism.scheme]) {
if (backend.authSchemes[authMechanism.scheme] && (authMechanism.visibility & neededVisibility)) {
selectAuthMechanism.append(
$('<option value="'+authMechanism.identifier+'" data-scheme="'+authMechanism.scheme+'">'+authMechanism.name+'</option>')
);
@ -1136,9 +1137,7 @@ MountConfigListView.prototype = _.extend({
saveStorageConfig:function($tr, callback, concurrentTimer) {
var self = this;
var storage = this.getStorageConfig($tr);
console.log(storage);
if (!storage || !storage.validate()) {
console.log('invalid');
return false;
}

View File

@ -95,6 +95,7 @@ class AuthMechanism implements \JsonSerializable {
$data += $this->jsonSerializeIdentifier();
$data['scheme'] = $this->getScheme();
$data['visibility'] = $this->getVisibility();
return $data;
}

View File

@ -22,6 +22,7 @@
namespace OCA\Files_External\Lib\Auth\Password;
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Service\BackendService;
use OCP\IL10N;
use OCP\IUser;
use OCA\Files_External\Lib\Auth\AuthMechanism;
@ -45,6 +46,7 @@ class UserProvided extends AuthMechanism {
$this
->setIdentifier('password::userprovided')
->setVisibility(BackendService::VISIBILITY_ADMIN)
->setScheme(self::SCHEME_PASSWORD)
->setText($l->t('User provided'))
->addParameters([