Copied to clipboard

Flag this post as spam?

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


  • Vishmay 19 posts 100 karma points
    Jun 15, 2017 @ 08:54
    Vishmay
    0

    how to use member id in userid parameter Umbraco ContentService SaveAndPublishWithStatus

    Hello,

    I've used API services for login and now I've created content editor in front end for a special type of content.

    I want to use SaveAndPublishWithStatus, it works perfectly with

      Services.ContentService.SaveAndPublishWithStatus(Content);
    

    Now I want to record that who has edited it. As I've logged in with a member, i want to record that member "test" has edited this content.

    When i try to pass its id in space of userid,but it provides me error

     Services.ContentService.SaveAndPublishWithStatus(Content,this.Members.GetCurrentMemberId());
    

    The purpose of providing member in user id is just auditing the content changes by default.

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Jun 15, 2017 @ 10:32
    Alex Skrypnyk
    101

    Hi Vishmay

    Members are front-end users, members were created for front-end actions, and by default, they can't change content items.

    SaveAndPublishWithStatus method can take second param = userId

    Users are for backend, they were created for managing content.

    So you have to use users for changing the content or make custom logic for storing changes.

    Thanks,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft