Jump to content

Giving access to files for different users at different times

Recommended Posts

I am working on a course website where online courses can be held.
I now have the problem of securing files. They should only be view/downloadable for the time the course lasts. These files are on a lection page. This is no problem for courses, that have a fixed start and end date. If the course/lection is unpubished, the files are not accesable with $config->pagefileSecure = true; in the config file.
But there will be permanent courses a user can start at a wished date lasting for a defined period. So I have to make the lection(s) available for specific users at and for an individual time.

Page structure:

|- lection 1
|- lection 2
|- ...
|- abo 1 
|- abo 2 (holds the data for one attendance of a course. Relation to user and course, and some other data like, when the course was started and will end)

I thought of creating a role for every course and a template for the lections of each course. Course 1 has a seperate template for its lections and also the lections of course 2 have a separate template and so on. Then I could give the role for the course the view permission at the corresponding lection template and give the user, that attended a course, the matching role. Then the user has access to the lection(s) and files on this lectionpage(s) as long he has the role. This should work, I think.

user1 -> roles: course1, course3 => access to lections with template1 and files of course1 and course3 
user2 -> role: course2 => access to lections with template2 and files of course 2

But this could be hard to maintain. If I need another filed for lections, I would have to add it to each separate lection template of each course.
I there a other way to manage this (page access control)?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...