lsst-epo / craft-canto-dam-integrator

Other
0 stars 0 forks source link

DAM plugin improvements #18

Closed blnkt closed 1 year ago

blnkt commented 2 years ago

The current Canto DAM Assets -> Craft CMS integration is in a prototype stage. Possible improvements/refinements include:

Current state of this plugin: https://github.com/lsst-epo/craft3-universal-dam-integrator Canto API: https://api.canto.com/

ericdrosas87 commented 2 years ago

Other possible features/fixes:

kylepratuch commented 1 year ago

Fix permissions bug that forces users to be admin to use the custom field

@ericdrosas87, are users forced to be admins on the Craft side or the Canto side? Asking because, after adding the craft permission from the plugin to the craft Editors user group, I was able to use the field as an editor user.

ericdrosas87 commented 1 year ago

@kylepratuch that's interesting, @blnkt and I both observed behavior to the contrary - that is, seemingly the Craft user was required to be an admin in order to use the custom asset field. If that is no longer the case then that's great, perhaps another code change fixed that issue?

kylepratuch commented 1 year ago

I'm curious to know how the issue manifested for you both.

During my initial testing and troubleshooting, I did have issues as an editor; I would be prompted to log into Canto, input my credentials, but then the Canto library select would be blank and I couldn't proceed. I noticed I was getting a 401 response from the context endpoint (something to the effect of "Missing credentials") and started looking into that, but later discovered it was because I was fiddling with permissions as a Craft admin in one Chrome instance while logged in as a Craft editor in a second incognito window. Trying as an editor in a regular Chrome window made all the difference.

ericdrosas87 commented 1 year ago

Ohhh you know what, I remember where things settled now. I implemented a fix by manually creating a permission and checking for that permission in the plugin. It worked fine for me locally, but it didn't work for Blake. I pushed the code out regardless because I was fairly certain that it would be something you would need to do anyway in addition to whatever other changes were needed. Maybe it was just a local issue for Blake though and the issue really is resolved?