Support for bulk file permission updates

I’m having some performance issues when using the GFA_File class to to grant file access for large numbers of files. My use case is granting groups access to educational courses. Each course has ~40 files, and there are ~60 courses, so if I’m granting a group access to every course that’s ~2400 files. This takes about 8 seconds. It works reliably and that’s not an impossibly long delay, but I’d like to cut it down if I can.

I think the slowdown is because GFA_File does individual database operations for each file. Does anyone know of way to reliably perform bulk updates to file permissions? I know I could do direct reading and writing of the groups databases, but I don’t want to do that if I can avoid it. I’d rather use the documented API

If there isn’t a way to do this now, it would be great to see the addition of batch operations to the GFA_File class that would cut down on the number of database operations.


Comments

3 responses to “Support for bulk file permission updates”

  1. Timothy Hagan Avatar
    Timothy Hagan

    Hi George – thanks for this (especially confirming I’m not missing something) and apologies for the delayed reply. It may take a few weeks, but I’ll reach out via email with some additional details and the code.

    I should say that this is a minor issue overall. We are making heavy use Groups and GFA to manage user access at the course level, and it’s been immensely helpful — it’s simple, reliable, well-documented and easy to interface with, so thanks for all the work you all are doing over there.

    1. Hey Timothy,

      Thanks for your feedback and looking forward to your next reply with all the interesting details.

      Cheers,
      George

  2. Hi Timothy,

    Welcome to our support channel for Groups File Access.

    What you noticed is correct, even when adjusting multiple files in bulk, each file is updated individually.
    Does this relate to a custom implementation you’re building? Would you mind sharing the code and the requirements with us? Does it necessarily have to update all files from all courses, or could you perhaps split the update process by group or by course?
    In case you wish to share it privately, you may send additional details to george at itthinx dot com.

    Kind regards,
    George