Skip to content

Allow public access #596

Closed
Closed

Description

@Zeigren

I'm looking at allowing visitors to view my InvenTree instance, I don't currently see a way to do this but I could be missing something.

Any ideas or preferences on how I might go about implementing this feature?

Activity

  1. SchrodingersGat commented on Dec 21, 2019

    @SchrodingersGat
    Member

    Django provides for "user permissions" which can apply to individual users or entire groups. These can provide fine-grained control of what users can access / read / write / delete (etc).

    I think this would be a good way to approach the problem, and create a "guest" account which can only view certain parts of the data.

    However this functionality needs to be used to actually restrict access to the particular data. I would also like to see it coded in way that is not particular to a single InvenTree instance (e.g. at the very least it covers InvenTree in a generic way, or it can be extended to meet particular needs).

    Docs:

  2. Zeigren commented on Feb 17, 2020

    @Zeigren
    Author

    Oh I never shared my thoughts on the actual implementation...

    My idea is to focus on group/role based permissions although user based permissions would of course still work. I plan on sticking with the default Django permissions as I think they should be good enough (view, change, add, delete).

    You'd create a group in the admin panel and set whatever permissions you would like that group to have, then add users to that group. These would be the broad restrictions that would apply to the API and top level UI elements, based on the model. These can be implemented with just Django.

    In order to use object based permissions we need a per object authentication backend like django-guardian, since that isn't natively supported in Django. On creation (or while being edited) each object should have a form that can be used to pick which groups have access to that object. What object permissions they have should be based on that groups model permissions, to keep it simple.

    You can use the admin panel to set user permissions per object or to fine tune the group permissions per object, but I think that's a bit much to add to the front end UI.

    I wound up with this approach since it was easier to implement an anonymous user and would add more to the project.

  3. SchrodingersGat commented on Oct 5, 2020

    @SchrodingersGat
    Member

    Hi @Zeigren check out the implementation in #1018

    Does this meet your requirements here?

  4. eeintech commented on Jan 13, 2021

    @eeintech
    Contributor

    @SchrodingersGat I think we should close this ticket, the role and permission system definitely allows for visitor/public/view-only profile.

  5. SchrodingersGat commented on Jan 13, 2021

    @SchrodingersGat
    Member

    Agreed, thanks for bringing this to my attention @eeintech

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions