Copied to clipboard

Flag this post as spam?

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


  • Heather Floyd 609 posts 1031 karma points MVP 6x c-trib
    Nov 26, 2018 @ 23:36
    Heather Floyd
    2

    Discussion: Add a way to specify the "System" user account for programmatic Node actions (rather than User 0)?

    I have been thinking about the default use of "User Id = 0" for API node actions. For example, the ContentService's CreateContent() method.

    I wish there were a way to globally "override" the default user being User 0 (or, for V8, user -1). Why? Because when nodes are manipulated programmatically, I'd rather the "User" logged for that action to be one named "System" or something. By default, when you install Umbraco for a new project, the email address & password entered into the installation wizard is assigned to User 0. Generally, these credentials represent an actual human, who will likely be creating content in the CMS manually as a regular content editor.

    I just feel like for information and auditing purposes, it's more accurate/useful for automated programmatic actions to be assigned to a "System" user.

    In terms of implementation, it wouldn't be difficult to update the API methods which utilize a default User parameter to check a config file for a different user id to use.

    It could be added in such a way that if the site implementer doesn't create an alternative user and specify the new ID in the config file, the current default behavior of User 0 would be used.

    Any thoughts?

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Nov 27, 2018 @ 00:38
    Søren Gregersen
    0

    The projects I’ve been on, we always start out by creating a “system” or “admin” user. A user that the developers use for creating doc types etc.

    Editors get their own users much later on.

    This way I don’t really get to the point you want to discuss :-)

  • Heather Floyd 609 posts 1031 karma points MVP 6x c-trib
    Nov 28, 2018 @ 17:01
    Heather Floyd
    0

    Hi Søren, Thanks for your response.

    Yes, sometimes I'm able to do that on new projects that I am setting up myself, but sometimes I am coming into an existing project, and someone else has set up the initial Umbraco installation.

    Also, with Umbraco Cloud, I believe that when you create a new site project, it will automatically be using your Umbraco Cloud portal account for the initial setup, which makes that trickier.

    I think the main issue is that at this point, once installation occurs, it's not possible to reassign "0" to a different user.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Nov 27, 2018 @ 04:33
    Shannon Deminick
    0

    As a work around you could rename the admin user to System, then create any other admin accounts you wish, that way user 0 (or -1 in v8) is System, would that suffice?

  • Heather Floyd 609 posts 1031 karma points MVP 6x c-trib
    Nov 28, 2018 @ 17:10
    Heather Floyd
    0

    Hi Shannon,

    Nice to hear from you :-)

    Yes, technically, I could rename the user and create another account for the actual user I am replacing, but depending on how long the project has been running already, that means changing the audit history, etc. (If the original User 0 was a real person who created content nodes, etc. Now those nodes show that "System" created them, which isn't really true.)

    Perhaps this issue seems very persnickety... but I guess it just bugs me that something which isn't really changeable nor actually "significant" (IDs are just random numbers) is used for this. That's why I figured it would be nice to have the option to specify WHICH user Id should be used for all default Service operations (I know that in my own custom code I could code in a userId as a parameter, but that won't affect packages and add-ins which use the default behavior)

Please Sign in or register to post replies

Write your reply to:

Draft