Copied to clipboard

Flag this post as spam?

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


  • Jay 409 posts 635 karma points
    Mar 02, 2023 @ 17:33
    Jay
    0

    uSync Umbraco V10 - moving usync from Settings section to a custom section

    Hi Kevin,

    Just checking to see if it's possible or if there's a way I can move usync from the Settings section to a custom section which I've created?

    Thanks

  • Kevin Jump 2309 posts 14673 karma points MVP 7x c-trib
    Mar 03, 2023 @ 11:06
    Kevin Jump
    100

    Hi Jay,

    Possible - think it works - not supported however . (because i haven't tested everything).

    1. create your own tree that inherits from uSync :

    (This example will move the tree to the 'translation' section)

    [Tree(Constants.Applications.Translation, "usync",
        TreeGroup = "sync",
        TreeTitle = "uSync", SortOrder = 35)]
    [PluginController("uSync")]
    public class uSyncCustomSectionTreeController : uSyncTreeController
    {
        public uSyncCustomSectionTreeController(
            ILocalizedTextService localizedTextService,
            UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
            IEventAggregator eventAggregator)
            : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
        {  }
    }
    

    2. Remove the original uSync tree from the tree collection

    (In a composer that runs after uSync does, we remove the original tree)

    [ComposeAfter(typeof(uSyncBackOfficeComposer))]
    public class uSyncTreeComposer : IComposer
    {
        public void Compose(IUmbracoBuilder builder)
        {
            builder.Trees()?.RemoveTreeController<uSyncTreeController>();
        }
    }
    

    n.b For permissions etc, to still work its important the tree alias stays as "usync".

  • Jay 409 posts 635 karma points
    Mar 07, 2023 @ 10:17
    Jay
    0

    Oh Thanks Kevin, I'll try it out

  • Jay 409 posts 635 karma points
    Mar 14, 2023 @ 15:17
    Jay
    0

    Hey Kevin, just to let you know that it works. Thanks for the help

  • Jay 409 posts 635 karma points
    Mar 14, 2023 @ 15:36
    Jay
    0

    Hey Kevin,

    I've been testing out a new Umbraco User Group which is only given accesss to this new uSync section. When they login it pops all the below

    enter image description here

    They can only view the section when I give the user group the Settings section.

    Is there a way around it do you know? Just so this user group can only access the Usync section without giving them permission to the Settings section?

    Thanks

  • Kevin Jump 2309 posts 14673 karma points MVP 7x c-trib
    Mar 14, 2023 @ 15:40
    Kevin Jump
    0

    Hi,

    Yeah at the moment i am not sure, because the ApiController has the SettingsAccess security on it.

    ( https://github.com/KevinJump/uSync/blob/v11/dev/uSync.BackOffice/Controllers/uSyncDashboardApiController.cs#L36-L42 )

    [Authorize(Policy = AuthorizationPolicies.SectionAccessSettings)]
    

    I think this might be something we can remove, but to be honest i would want to do some proper testing before just getting rid of it on the controller.

    I don't know if you can replace the controller like we have with the tree once above. but i suspect it probibly won't work the same.

  • Kevin Jump 2309 posts 14673 karma points MVP 7x c-trib
    Mar 15, 2023 @ 10:00
    Kevin Jump
    0

    Hi,

    Done some tests, i think we can remove that authorization policy (as long as we keep the tree one).

    We have a nightly build for v10 - that has this in if you want to try it and see if it works for you:

    https://dev.azure.com/jumoo/Public/_artifacts/feed/nightly/NuGet/uSync/overview/10.3.4-build.20230315.1

Please Sign in or register to post replies

Write your reply to:

Draft