Separation of writable update from field load method

This commit is contained in:
Petr Vobornik
2011-11-25 14:44:40 +01:00
committed by Endi S. Dewata
parent e271e80f7d
commit 6e3a21a115

View File

@@ -187,6 +187,13 @@ IPA.field = function(spec) {
that.values = [''];
}
that.load_writable(record);
that.reset();
};
that.load_writable = function(record) {
that.writable = true;
if (that.metadata) {
@@ -199,14 +206,12 @@ IPA.field = function(spec) {
}
}
if (that.record.attributelevelrights) {
var rights = that.record.attributelevelrights[that.name];
if (record.attributelevelrights) {
var rights = record.attributelevelrights[that.name];
if (!rights || rights.indexOf('w') < 0) {
that.writable = false;
}
}
that.reset();
};
that.reset = function() {