DDX Form and Dataset - Allow users to edit or remove entries

I have a DDX Brick setup to allow users to input items into a form that I then use in an ETL to filter our specific rows. By default, the DDX form is set to only allow the owner (myself) to edit or remove entries. I would like to set this up to allow anyone with access this ability. I was able to successfully modify the javascript to have the add/remove buttons to show up for all users, not just the owner, however other users are not actually able to successfully remove/edit anything.

Does anyone know if this is actually possible or does this have to do with Domo user permissions preventing changes being made?

Tagged:

Answers

  • This is likely the issue of underlying Domo permissions as users would need to have dataset edit privileges to make changes to the dataset.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • JosephMeyers
    JosephMeyers Domo Employee

    AppDB and Datasets are separate things and the permissions are also handled separately. We have an upcoming feature to make it easier to deal with permissions on AppDB but you currently can make changes using endpoints detailed here - https://developer.domo.com/docs/dev-studio-references/appdb#Collection%20Level%20Security

  • JosephMeyers
    JosephMeyers Domo Employee

    I also forgot about the wiring screen. When you edit the card you can set the access granted by the app instance. It should default to what you need already, then you just need to share the card with the users you want to have access.


  • I've tried various combinations of app permissions. Currently, I have all permissions set. Users are able to see and click the Delete button which does remove it from the current window however once refreshed or any other change is made, the deleted rows re-appear. I've also tried using the endpoints from that same page with no luck.

    This is my "remove" function at the moment. My javascript experience is quite rusty so it's very likely I'm doing something wrong here but I've tried various different ways of writing this function with various diffent permissions set without any success.

     function remove(documentId){
      const test = location.href.substring(8,44);
      domo.delete(`/domo/datastores/v1/collections/Users/permission/RYUU_APP/${test}?permissions=admin`);
      return domo.delete(`/domo/datastores/v1/collections/${collectionName}/documents/${documentId}`).then(res => {
       var index = cache.findIndex(doc => doc.id === documentId);
       cache.splice(index, 1);
      });
    

  • @TylerMarshall I had the same issue and commented out all these sections of code which now allows all my users to use the brick. This DDX brick is especially useful because I can have my basic users (no card or dataset access) to edit it.

    JavaScript


    CSS

    **If this answer solved your problem be sure to like it and accept it as a solution!

  • @Ashleigh I tried this and while this does enable the buttons for the other users, they still are not able to edit/delete rows even on a fresh instance of the DDX Form. I had a similar solution in place however I just switched the return from the 'isViewTheOwner' function to be 'return 1===1' so that all users would be set as the owner.

    function isViewerTheOwner() {
      return Promise.all([
        collectionService.getCollectionInfo(),
        domo.get('/domo/environment/v1'),
      ]).then(function([info, env]){
        return 1 === 1;
      });
    }
    


    Were there any other changes you made?

  • @TylerMarshall hmm that is weird, my users are able to with those changes. Do they see the pencil icon?


    **If this answer solved your problem be sure to like it and accept it as a solution!

  • @Ashleigh Yes, they see all the same icons I am able to see. When they click the trashcan, the line will disappear however as soon as the page refreshes, it will return as no real change was made to the data. When they try to edit lines, the app freezes when they click save

  • @TylerMarshall what do you have this line as? It is default to False, you have to make it True if you want changes synced to the dataset.


    **If this answer solved your problem be sure to like it and accept it as a solution!

  • @Ashleigh That is set to true.

  • @TylerMarshall I would put a ticket in, seems like maybe there is a different issue. Only other thing you could check if roles/access to the data.

    **If this answer solved your problem be sure to like it and accept it as a solution!

  • JosephMeyers
    JosephMeyers Domo Employee

    Tyler on your example code you are running a domo.delete to set a permission? That should be a PUT to set a permission. I also see "Users" in your call. In the code example in the documentation that would be the collection name for the example but this may be different than what yours is. You also don't need to set the permission every time you want to delete the document.

    Most likely all you need to do is make sure that collection in the wiring screen (when you edit the app card) has the delete content permission set and then the card is shared to the user that is doing deletes.

    The buttons are front end don't necessarily mean the user has the access on the collection to make the changes. If you monitor the network calls when you make these actions it will show you if it's being blocked due to rights or not. That may shed more light on what is actually happening.

    Lastly, this DDX Brick will not work in a public embed context as we block all AppDB access like this for public embed. You would just want to do a normal custom app and not DDX if you are wanting embed.

  • JosephMeyers
    JosephMeyers Domo Employee

    I just did some more research into this and it looks like that specific DDX Brick has additional required authorities (aka grants) that more locked down users may not have. I am contacting the team that made the DDX Brick to have them update the documentation on what authorities are required for it.

  • JosephMeyers
    JosephMeyers Domo Employee

    Looks like the Manage DataSet grant is currently needed for a user to be able to edit the collection used by this app.