Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stefano Beretta 102 posts 247 karma points
    Jul 22, 2019 @ 12:29
    Stefano Beretta
    0

    Save&Publish button

    Hi!

    I have an Explicit workflow configured by documentType and a user of group "Editor" (and also of group "My custom group").

    When I log as Admin I correctly see the sub button group including the option "Save and Publish", but when I log in as the "Editor user" shouldn't the "Save and Publish" option disappear?

    Should I remove from the group the permission to "Save and Publish"? Looking at the workflow.js it seems that

    defaultButtons.defaultButton
    

    is the "Save and Publish" button.

     var subButtons = saveAndPublish ? [buttons.unpublishButton, defaultButtons.defaultButton, buttons.saveButton] : [buttons.unpublishButton, buttons.saveButton]; // insert the default unpublish button into the subbutton array
    

    Thank you!!!

    S

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Jul 22, 2019 @ 20:54
    Nathan Woulfe
    1

    Ah, good find - there definitely should be a check there to remove save+publish for non-admin users.

    I think the same issue will exist for scheduled publishing, where an editor could schedule a change and have it go live outside the workflow. Need to double check that too.

    Will look into both.

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Jul 23, 2019 @ 06:11
    Nathan Woulfe
    100

    I've made a change, verified it, seems to solve the issue. Build is running now.

    Try grabbing the zip from https://ci.appveyor.com/project/nathanwoulfe/umbracoworkflow/build/artifacts, and replacing the javascript in your site with the new version.

    If that solves it, I can push a proper release.

  • Stefano Beretta 102 posts 247 karma points
    Jul 23, 2019 @ 07:06
    Stefano Beretta
    0

    Woah, so fast :D

    The new js has solved my situation :D

    Thank you so much

    H5YR

    S

  • Stefano Beretta 102 posts 247 karma points
    Jul 25, 2019 @ 13:27
    Stefano Beretta
    0

    Hmmm... sorry for bothering you (again).

    I noticed now that with the new "workflow.js" now the Admin doesn't have the permission to "Save and Publish" directly (assuming the administrator can do it).

    I search a bit and discovered that

    if (_this12.isAdmin) 
    

    inside the function setButtons() is undefined

    I added

    _this12.isAdmin = user ? user.allowedSections.indexOf('workflow') !== -1 : false;
    

    before the if and now it seems working correctly (the Admin now has both umbraco and plumber options)

    I don't know if it's a bug or not, I just wanted you to know it :D

    Thank you

    S

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Aug 01, 2019 @ 04:07
    Nathan Woulfe
    0

    Hey Stefano! No bother at all, I appreciate it!

    I've added a fix for this issue, same goes as the previous one - build will update, try the new JS file and let me know if that resolves it correctly, then I can push a version update.

    N

Please Sign in or register to post replies

Write your reply to:

Draft