Giter Club home page Giter Club logo

Comments (3)

br41nslug avatar br41nslug commented on June 25, 2024

Can you show reproduction steps for how to get into the state of having duplicated permissions in the first place?

from directus.

NilsBaumgartner1994 avatar NilsBaumgartner1994 commented on June 25, 2024

See the isse #22613 by using the REST API. The issue was found since a script ran and added the same role, collection and action twice.
Also the same problem is already mentioned in: #21965
https://github.com/tractr/directus-sync?tab=readme-ov-file#remove-permission-duplicates

I think it would be better to close the issue here and mention it in the original #21965 as of duplicate.

This way two permissions are created resulting in the soft lock state, as mentioned in the issue referenced.

const response = await fetch(`http://127.0.0.1/api/permissions`, {
            agent: httpsAgent,
            method: 'POST',
            headers: {
                "Cookie": headers.get('cookie'),
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({
                role: permission.role,
                collection: permission.collection,
                action: permission.action,
                fields: permission.fields,
                permissions: permission.permissions,
                validation: permission.validation,
            }),
        });

from directus.

br41nslug avatar br41nslug commented on June 25, 2024

Closing this in favor of #21965 the optimal solution here would be to prevent duplicate permissions instead of deduplicating them after the fact (that should be done as a one time fix)

from directus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.