define("OpportunityActionsDashboard", [], function(){return{
messages:{"InitVisibilityByRights":{
mode:this.Terrasoft.MessageMode.BROADCAST,
direction:this.Terrasoft.MessageDirectionType.SUBSCRIBE},
"GetInitVisibilityByRights":{
mode:this.Terrasoft.MessageMode.BROADCAST,
direction:this.Terrasoft.MessageDirectionType.PUBLISH}},
methods:{/**
* @inheritdoc Terrasoft.BaseActionsDashboard#subscribeSandboxEvents
* @overridden
*/
subscribeSandboxEvents: function(){this.callParent(arguments);
var sandbox =this.sandbox;
var tags =[sandbox.id];
sandbox.subscribe("InitVisibilityByRights", this.initVisibilityByRights, this, tags);
sandbox.publish("GetInitVisibilityByRights");},
/**
* Initializes the visibility of the panel content
*/
initVisibilityByRights: function(value){this.set("ContentVisible", value);}},
diff:/**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/};});
and then modify edit page:
messages:{"InitVisibilityByRights":{
mode:this.Terrasoft.MessageMode.BROADCAST,
direction:this.Terrasoft.MessageDirectionType.PUBLISH},
"GetInitVisibilityByRights":{
mode:this.Terrasoft.MessageMode.BROADCAST,
direction:this.Terrasoft.MessageDirectionType.SUBSCRIBE}},
attributes:{//this is the attribute that determines the visibility"IsColumnVisibleByOwnerOrFuncRole":{
dependencies:[{
columns:["IsColumnVisibleByOwnerOrFuncRole"],
methodName:"publishVisibilityByRights"}]}},
methods:{
subscribeSandboxEvents: function(){this.callParent(arguments);this.sandbox.subscribe("GetInitVisibilityByRights", this.publishVisibilityByRights, this);},
/**
* Publishes the visibility tag to other modules
*/
publishVisibilityByRights: function(){
var moduleIds =this.getModuleIds();
moduleIds.push(this.sandbox.id);
var value =this.get("IsColumnVisibleByOwnerOrFuncRole");this.sandbox.publish("InitVisibilityByRights", value, moduleIds);}},