Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucieo committed Mar 5, 2024
2 parents 70dbe38 + 9619bcd commit bd719b4
Show file tree
Hide file tree
Showing 18 changed files with 827 additions and 811 deletions.
22 changes: 11 additions & 11 deletions back/api/application/config/policies/can-update.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = async (ctx, next) => {
const { id } = ctx.params;
const { id } = ctx.params

if (id && ctx.state.user) {
const { user } = ctx.state;
const { user } = ctx.state

const application = await strapi
.query("application")
.findOne(
{ id }
)
const application = await strapi.query('application').findOne({ id })

// Only application place can update application status
if(application && application?.espace?.users_permissions_user === user.id){
return await next();
if (
application &&
(application?.espace?.users_permissions_user === user.id ||
application?.company?.id === user.id)
) {
return await next()
}
}

ctx.unauthorized(`Not allowed`);
};
ctx.unauthorized(`Not allowed`)
}
Loading

0 comments on commit bd719b4

Please sign in to comment.