strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.

Home Page:https://market.strapi.io/plugins/strapi-plugin-slugify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we override the API request for `slugify/slugs`

selected-pixel-jameson opened this issue · comments

Is there a way to override the slugify/slugs endpoint? I have a specific use case where I want to perform additional security checks before returning a response.

Override as in additional custom policies?

Maybe that's how one would go about this. I'm still very new to Strapi. I was just looking for a way to be able to override this function similar to how you override find, findOne, create or update.

ah, that I am not sure. What checks are you trying to do?

I took a look at policies. Yes, I'm looking for a way to attach a custom policy to this.

I need a way to add a layer of security to this request so that a response is only returned when the request is for content that is explicitly flagged as 'public' and this needs to be set on the server for security purposes. I can't do this using a query on the client.

I also need to check to see if the user making the request has the ability to edit the content which is determined by various properties on the model being requested.

Model specific policies should already be supported v2.1.1+.

By default it behaves like any other route. If the user who requested the model does not have permission to find it then it will return unauthorized.

I do not have the chance to confirm this at the moment but any additional policies on the model(s) should also be respected.

No problem, closing for now. It can be reopened if model policies are not being respected.