Exemplo n.º 1
0
 public bool Asset(
     [FromQuery] int appId,
     [FromBody] AssetEditInfo template,
     [FromQuery] int templateId = 0,
     [FromQuery] string path    = null, // identifier is either template Id or path
     // todo w/SPM - global never seems to be used - must check why and if we remove or add to UI
     [FromQuery] bool global = false
     ) => Backend().Save(appId, template, templateId, global, path);
Exemplo n.º 2
0
        public bool Asset([FromBody] AssetEditInfo template, [FromUri] int templateId = 0, [FromUri] bool global = false, [FromUri] string path = null, [FromUri] int appId = 0)
        {
            var wrapLog     = Log.Call <bool>($"templ:{templateId}, global:{global}, path:{path}");
            var assetEditor = GetAssetEditorOrThrowIfInsufficientPermissions(appId, templateId, global, path);

            assetEditor.Source = template.Code;
            return(wrapLog(null, true));
        }
Exemplo n.º 3
0
        public bool Save(int appId, AssetEditInfo template, int templateId, bool global, string path)
        {
            var wrapLog     = Log.Call <bool>($"templ:{templateId}, global:{global}, path:{path}");
            var assetEditor = GetAssetEditorOrThrowIfInsufficientPermissions(appId, templateId, global, path);

            assetEditor.Source = template.Code;
            return(wrapLog(null, true));
        }
Exemplo n.º 4
0
        public bool Asset([FromBody] AssetEditInfo template, [FromUri] int templateId = 0, [FromUri] bool global = false, [FromUri] string path = null)
        {
            var assetEditor = (templateId != 0 && path == null)
                ? new AssetEditor(SxcContext.App, templateId, UserInfo, PortalSettings)
                : new AssetEditor(SxcContext.App, path, UserInfo, PortalSettings, global);

            assetEditor.EnsureUserMayEditAsset();
            assetEditor.Source = template.Code;
            return(true);
        }
Exemplo n.º 5
0
        public bool Asset([FromBody] AssetEditInfo template, [FromUri] int templateId = 0, [FromUri] bool global = false, [FromUri] string path = null)
        {
            Log.Add($"asset templ:{templateId}, global:{global}, path:{path}");
            var isAdmin     = UserInfo.IsInRole(PortalSettings.AdministratorRoleName);
            var assetEditor = (templateId != 0 && path == null)
                ? new AssetEditor(SxcInstance.App, templateId, UserInfo.IsSuperUser, isAdmin)
                : new AssetEditor(SxcInstance.App, path, UserInfo.IsSuperUser, isAdmin, global);

            assetEditor.EnsureUserMayEditAsset();
            assetEditor.Source = template.Code;
            return(true);
        }
Exemplo n.º 6
0
 public bool Asset([FromBody] AssetEditInfo template, [FromUri] int templateId = 0, [FromUri] bool global = false, [FromUri] string path = null, [FromUri] int appId = 0)
 => Backend().Save(template, templateId, global, path, appId);