<commit_before>var getTypeObj, breadcrumbItems;
var deploymentManagement=require('/modules/deployment/deployment.manager.js').deploymentManagementModule();
var deploymentManager=deploymentManagement.cached();

var server = require('store').server;
var permissions=require('/modules/permissions.js').permissions;
var config = require('/config/publisher.json');

var log = new Log();

breadcrumbItems = deploymentManager.getAssetData()

var generateLeftNavJson = function(data, listPartial) {

    var user=server.current(session);
    var um=server.userManager(user.tenantId);
    var createActionAuthorized = permissions.isAuthorized(user.username, config.permissions.webapp_create, um);

    var editEnabled = true;

    var currentTypeObj = getTypeObj(data.shortName);
	
    var leftNavItems = { leftNavLinks :
        [
           /*
            {
                           name : "Browse All",
                           additionalClasses : "active",
                           url : "/publisher/assets/" + data.shortName + "/"
                       },*/
           
         /*   {
                name : "Add " + data.shortName + "",
                iconClass : "icon-plus-sign-alt",
                additionalClasses : (listPartial == "add-asset" ) ? "active" : null,
                url : "/publisher/asset/" + data.shortName + ""
            },
            {
                name: "Statistics",
                iconClass: "icon-dashboard",
                additionalClasses : (listPartial == "statistics" ) ? "active" : null,
                url: "/publisher/assets/statistics/" + data.shortName + "/"
            }*/
        ]
    };
    if(data.artifact){

        editEnabled = permissions.isEditPermitted(user.username, data.artifact.path, um);
        if(data.artifact.lifecycleState == "Published"){
            editEnabled = false;
        }
        if(user.hasRoles(["admin"])){
            editEnabled = true;
        }

        if(createActionAuthorized) {
            if(editEnabled) {
                leftNavItems = {
                    leftNavLinks: [
                        {
                            name: "Edit",
                            iconClass: "icon-edit",
                            additionalClasses: (listPartial == "edit-asset" ) ? "active" : null,
                            url: "/publisher/asset/operations/edit/" + data.shortName + "/" + data.artifact.id + ""
                        },
                        {
                            name: "Create New Version",
                            iconClass: "icon-file",
                            additionalClasses: (listPartial == "copy-app" ) ? "active" : null,
                            url: "/publisher/asset/operations/copyapp/" + data.shortName + "/" + data.artifact.id + ""
                        }
                    ]
                };
            }else{
                leftNavItems = {
                    leftNavLinks: [
                        {
                            name: "Edit",
                            iconClass: "icon-edit",
                            additionalClasses: (listPartial == "edit-asset" ) ? "active" : false,
                            url: "#",
                            title: "Edit Action not permitted."
                        },
                        {
                            name: "Create New Version",
                            iconClass: "icon-file",
                            additionalClasses: (listPartial == "copy-app" ) ? "active" : null,
                            url: "/publisher/asset/operations/copyapp/" + data.shortName + "/" + data.artifact.id + ""
                        }
                    ]
                };
            }
        }else{
            leftNavItems = { leftNavLinks: [

            ]
            };
        }
    }

    if(listPartial == "edit-asset" || listPartial == "copy-app"){
        leftNavItems ={};
    }

    return leftNavItems;
};

getTypeObj = function(type){
	for(item in breadcrumbItems){
		var obj = breadcrumbItems[item]
		if(obj.assetType == type){
			return obj;
		}
	}<commit_msg>remove edit button from creator when app is published<commit_after>var getTypeObj, breadcrumbItems;
var deploymentManagement=require('/modules/deployment/deployment.manager.js').deploymentManagementModule();
var deploymentManager=deploymentManagement.cached();

var server = require('store').server;
var permissions=require('/modules/permissions.js').permissions;
var config = require('/config/publisher.json');

var log = new Log();

breadcrumbItems = deploymentManager.getAssetData()

var generateLeftNavJson = function(data, listPartial) {

    var user=server.current(session);
    var um=server.userManager(user.tenantId);
    var createActionAuthorized = permissions.isAuthorized(user.username, config.permissions.webapp_create, um);

    var editEnabled = true;

    var currentTypeObj = getTypeObj(data.shortName);
	
    var leftNavItems = { leftNavLinks :
        [
           /*
            {
                           name : "Browse All",
                           additionalClasses : "active",
                           url : "/publisher/assets/" + data.shortName + "/"
                       },*/
           
         /*   {
                name : "Add " + data.shortName + "",
                iconClass : "icon-plus-sign-alt",
                additionalClasses : (listPartial == "add-asset" ) ? "active" : null,
                url : "/publisher/asset/" + data.shortName + ""
            },
            {
                name: "Statistics",
                iconClass: "icon-dashboard",
                additionalClasses : (listPartial == "statistics" ) ? "active" : null,
                url: "/publisher/assets/statistics/" + data.shortName + "/"
            }*/
        ]
    };
    if(data.artifact){

        editEnabled = permissions.isEditPermitted(user.username, data.artifact.path, um);
        if(data.artifact.lifecycleState == "Published"){
            editEnabled = false;
        }
        if(user.hasRoles(["admin"])){
            editEnabled = true;
        }

        if(createActionAuthorized) {
            if(editEnabled) {
                leftNavItems = {
                    leftNavLinks: [
                        {
                            name: "Edit",
                            iconClass: "icon-edit",
                            additionalClasses: (listPartial == "edit-asset" ) ? "active" : null,
                            url: "/publisher/asset/operations/edit/" + data.shortName + "/" + data.artifact.id + ""
                        },
                        {
                            name: "Create New Version",
                            iconClass: "icon-file",
                            additionalClasses: (listPartial == "copy-app" ) ? "active" : null,
                            url: "/publisher/asset/operations/copyapp/" + data.shortName + "/" + data.artifact.id + ""
                        }
                    ]
                };
            }else{
                leftNavItems = {
                    leftNavLinks: [
                        {
                            name: "Create New Version",
                            iconClass: "icon-file",
                            additionalClasses: (listPartial == "copy-app" ) ? "active" : null,
                            url: "/publisher/asset/operations/copyapp/" + data.shortName + "/" + data.artifact.id + ""
                        }
                    ]
                };
            }
        }else{
            leftNavItems = { leftNavLinks: [

            ]
            };
        }
    }

    if(listPartial == "edit-asset" || listPartial == "copy-app"){
        leftNavItems ={};
    }

    return leftNavItems;
};

getTypeObj = function(type){
	for(item in breadcrumbItems){
		var obj = breadcrumbItems[item]
		if(obj.assetType == type){
			return obj;
		}
	}
{'fraction_non_alphanumeric': 0.11964082458581005, 'fraction_numerical': 0.0, 'mean_word_length': 1.347980997624703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6749774', 'n_tokens_mistral': 2047, 'n_tokens_neox': 1953, 'n_words': 343}