1 Reply Latest reply on Feb 12, 2013 4:25 AM by vasilievip

    Making a writable connector read-only

    rhauch

      ModeShape currently has two kinds of connectors:

       

      • Read-only connectors - these are connectors that only support reading content from external systems, and that are coded to never support writes. One example is the GitConnector.
      • Writable connectors - these are connectors that can read content from an external system AND make changes to the data in that external system. One example is the FileSystemConnector.

       

      It seems useful to me to be able to set up federation so that, even when I'm using a writable connector, I want to be able to tell ModeShape that it should never update the data in a particular external source. Consider this example: a web application wants to expose the files/folders in a particular area of the file system in an area of the repository, and the application will only allow reading the files/folders (since updating the files/folders is via some existing, external process). In this case, the FileSystemConnector always allows writes, which means I'll have to code my application to avoid changing any content, while ModeShape won't guarantee any particular behavior. However, if I could configure the external source in ModeShape's configuration to be "read-only", then ModeShape would enforce this behavior.

       

      So, two questions:

       

      Is it useful/beneficial to be able to configure a writable connector as read-only? Why or why not?

       

      If so, should it be on a connector-by-connector basis, or should all writable connectors have an implicit "readonly" attribute?

       

      Please let us know what you think!

       

      (See MODE-1791 for background on why we're asking this.)

        • 1. Re: Making a writable connector read-only
          vasilievip

          Randall Hauch wrote:

          Is it useful/beneficial to be able to configure a writable connector as read-only? Why or why not?

          Yes, to satisfy security concerns as you descibed above with filesystem example.

           

           

          Randall Hauch wrote:

           

          If so, should it be on a connector-by-connector basis, or should all writable connectors have an implicit "readonly" attribute?

           

          My vote to have readonly flag and "false" by default for writable connectors, so I'll change it only if I need to prevent modifications (not vice versa). Making this attribute available to all writable (and only writable) connectors makes sense to me, something like that: Connector (only API to query) -> WritableConnector  (API to write) -> FileSystemConnector.

          1 of 1 people found this helpful