Git Product home page Git Product logo

Comments (3)

fisharebest avatar fisharebest commented on May 30, 2024

There might have been some performances differences in the past, but now that the preferences are all retrieved once, there should not be much difference.

I think you are correct. The code would be much clearer if it simply used

!userGedcomAdmin(WT_USER_ID, $gedcom_id)

If you have time to update this.... ;-)

from webtrees.

jon48 avatar jon48 commented on May 30, 2024

Hello, and sorry I did not reply earlier, I was away for few days.

I can update it indeed, as it would bring a lot more clarity to the code.
The only point to keep in mind (as commented in #129) is that there is the case where the user is not explicitly an admin of the gedcom for which the method userGedcomAdmin needs to check whether it is a global administrator or not. To do so, it needs a call to the DB (as there is no cache for users' global preferences). In the current logic, the method is called only in the case where $ged_id!=WT_GED_ID, but if we simplify it, it would be called in all cases, so would bring a slight performance hit for users who are global admin without being the current gedcom admin.

Let me know your thoughts about it.

I can as well in parallel try to work on a improvement on users' global preferences, the same way you did for Gedcom/Tree, with maybe the introduction of a WT_User class.

Jonathan

from webtrees.

fisharebest avatar fisharebest commented on May 30, 2024

I have created an initial WT_User class.

I need to test this with various versions of PHP

from webtrees.

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.