|
[
Permalink
| « Hide
]
Brian Warling added a comment - 25/Sep/08 02:38 AM
I'm hoping this can be addressed soon. Because of this, we've disabled course restore for non-administrators. Thanks... Brian
I agree that the users should not be added; however, we also need to add feedback so that the user attempting to restore understands that they did not have the privileges and that the user was not added. My +1 for working this out. Perhaps the capability for teachers to create users and ability to create users on restore should be distinguished. Peace - Anthony
Martin Dougiamas made changes - 06/Oct/08 04:49 PM
Martin Dougiamas made changes - 06/Oct/08 04:50 PM
+1 from us on this too. Seems like a serious circumvention of security model. This could be exploited maliciously, through specially crafted course restore files, all be itt only to create non-privileged users.
David - This is a simple way to prevent the users from being created. I've not tested it but I just wanted to provide a quick way to prevent the users from actually being created. I do not know what impact this might have on other aspects of the restore in terms of the assignments for users that are not created in the restore. I think ultimately the error message should be specific about the user data that is not restored and the reason. I didn't want to create new language strings for this simple patch but thought it might be a step in the right direction for those who feel like they cannot allow teachers to do restores. Peace - Anthony
p.s. - Eloy - Do you think that we should label this as a possible security issue? I could see the argument being made but I don't see too much harm in it.
Anthony Borrow made changes - 24/Dec/08 07:42 AM
Petr Skoda made changes - 22/Jan/09 02:18 AM
Petr Skoda made changes - 22/Jan/09 02:20 AM
While I fully agree that the creation of users by non-authorized instructors/course creators needs to be restricted, we need to be sure that this capability can be easily allowed in cases where it is desirable.
I, for example, have a Moodle set up where I am giving course space to teachers at other institutions. They want to use my "MoodleReader module" but for various reasons (mainly the resistance of local staff admins) can't set it up on their own institution's server. I would like them to be able to back up the users in their courses and then restore them to their course on my Moodle so that I don't have to intervene each time. Without the current "bug" they would have to have the students enroll via the mail/confirmation process. This simply would not work efficiently with a large number of students – too many misentered email addresses or other ways that the confirmation message might go astray. Thomas - Any reason why you could not assign the user create capability to those teachers? It would seem that would allow you to do what you want if I understand it correctly. Peace - Anthony
Petr Skoda made changes - 06/May/09 06:21 PM
Hello, here at Federal University Of Santa Catarina, Brazil, we have a system that sincronizes the central database of the university with the moodle database, with that all users are automatically created and the data automatically updated.
We let the teachers import courses from any moodle installation they want and sometimes it is not possible to do the backup of original course without user information. If we can set a permission to not allow they create users during backup would be great. why not simply add new capability "moodle/backup:createusers", this would be more backwards compatible imho
I like Peter's approache. A new capability would be great
Eloy, can we add a new capability for 1.9.6 ? This bug has a lot of votes.
Martin Dougiamas made changes - 05/Oct/09 04:01 PM
David Mudrak made changes - 05/Oct/09 05:44 PM
Sorry,
really I don't think that using "moodle/user:create" neither "moodle/backup:createusers" is the proper solution. For me there are more "variables" is this problem. Let me explain the thing with one simple use-case: Imagine server "A", with course "C" and student "S" enrolled (and with forum posts and other activity on it). Teacher makes backup of course "C". Obviously it will include information of user "S" plus all his forum posts. Then, for any reason, student is "deleted" from server A (so his login is changed along with other personal information), although forum posts and related info continues there, associated with the "deleted" user. Then, teacher tries to restore backup into a new course, or into the same course (A) but deleting data first. At this point, student "S" won't be found anymore in the server (check is performed by login - another problem - that has been trashed by the deletion), so restore MUST re-create it or, later in the process, when restoring forum posts, there won't be any user to link the info to). If we rely on any capability to decide if users will be created or no, we can easily end with non-restorable information. So, simple check isn't enough at all (nor for restoring in a different server nor for restoring in the same server, it's important to note that the problem can happen in any server, as the use case above demoes). So, IMO, we can follow only 2 "safe" approaches:
So... summarising, we have two alternatives:
Sorry but the long comment, just trying to explain that it isn't only a matter of adding one capability (unless we want to be radical). Please comment, ciao Eloy says:
>Implement a complete user pre-check with an stronger match than the current one. More complex to implement but also tons better solution. This is fine, but the site administrator needs to be able to elect whether this pre-check is enforced or not. As I stated in my comment of 22/Apr/09, I have sites where I need to permit others to do such restores. Can there be a capability created which, if assigned, would permit specific users to restore without the strict check? Hi Thomas,
yes, I think we can use that new proposed capability "moodle/backup:createusers" to allow users not having "moodle/user:create" (admins) to bypass any check/restriction. No problem with that. They keys here are which approach we must follow (the "radical" or the "correct" one above) and which defaults (for each legacy role) should we apply to that new capability "moodle/backup:createusers". Ciao My vote goes to the "correct" solution, but it'd be good to give the option to proceed with the restore without the user info.
IMHO, only admins should get "moodle/backup:createusers" by default. Hi,
I think both approaches proposed by Eluy have merit. The "correct" one is fine, and the sophisticated way. I vote for this for people with "moodle/backup:createusers" capability. But the "radical" has its own merit. A configurable switch to disallow teachers to restore users &userdata would be very useful (now, we hack restorelib for this purpose): i.e. vote also for capability check to fall into no users/no user info restore when "moodle/user:create" is not allowed.
Eloy Lafuente (stronk7) made changes - 20/Oct/09 05:23 PM
Moving this to 1.9.7.
I'm aimed to do this in the "correct" way: new capability + pre-check all users, but it isn't trivial to implement now. I hope to be able to do so as we'll need that also for 2.0 (where I'm working now).
Petr Skoda made changes - 16/Nov/09 03:47 AM
We talked about a moodle/backup:userinfo setting for 1.9.7 that disallows all user restoring (including creating) and user data, similar to what Enrique mentioned above.
Eloy Lafuente (stronk7) made changes - 16/Nov/09 10:30 PM
Hello,
i have seen a commit at MOODLE_19_STABLE (http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=commit;h=f484cb3e30e485958bafe54a391064e5d298d6c2
Eloy Lafuente (stronk7) made changes - 19/Nov/09 02:37 AM
Hi Daniels,
both MDL-20834 (moodle/backup:userinfo) and MDL-20849 (moodle/restore:userinfo) are there to prevent completely any backup/restore operation related with user data. Not only the creation of users but anything related with users (like forum posts, assignment submissions...). Both are being implemented right now and both will debut in Moodle 1.8.11 and Modle 1.9.7. About how they are related with this issue, I'd say that only "tangentially"; they are more restrictive than the proposed "moodle/restore:createuser" as far as they prevent ANY operation with user info, not only account creation but ANY user info. But, no matter of them, and how every site/institution decides to use them (note that, by default, they aren't granted to teachers!), the "moodle/restore:createuser" must land sooner than later, with proper pre-check and so on, as commented above. And will work together with the moodle/restore:userinfo one, so both will need to be allowed to successfully restore courses needing to create users. I hope I'll be able to finish the bugs above (and some more I've pending for 1.8.11, 1.9.7 releases) and then, invest some time with this (new capability + proper pre-check). Ciao |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||