Skip to content

Instantly share code, notes, and snippets.

@elchele
Last active August 29, 2015 14:27
Show Gist options
  • Save elchele/0f2c81452f3b3f4d3f33 to your computer and use it in GitHub Desktop.
Save elchele/0f2c81452f3b3f4d3f33 to your computer and use it in GitHub Desktop.
Custom Record view controller for removing fields not accessible via ACL.
({
/* File: ./custom/clients/base/views/record/record.js */
extendsFrom: 'RecordView',
_render: function(){
var self = this;
this._super('_render');
_.each(this.noEditFields, function(field){
if (app.acl.hasAccessToModel('edit', self.model, field) == false)
{
this.$('div[data-name=' + field + ']').remove();
}
});
},
_dispose: function() {
this._super('_dispose');
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment