Bug #4651

Denied access in documents tool in student view mode

Added by Julio Bonifacio Aliaga about 8 years ago. Updated almost 8 years ago.

Rejected - Abandoned
Julio Bonifacio Aliaga
Target version:
Start date:
Due date:
% Done:


Estimated time:
0.50 h
Spent time:
SCRUM pts - complexity:


When using "View as student" (but registered as portal admin and teacher of the course), when I enter the documents tool (made invisible but still available through a link on another icon), I get a message saying I am not allowed: "Lo sentimos, no le está permitido acceder a esta página o su conexión ha caducado. Para volver a la página anterior pulse el enlace inferior o haga clic en el botón "Atrás" de su navegador.".

This happens when no document or directory is visible, but it also happens when I make the "Images" directory visible.


learner_view.png (22.4 KB) learner_view.png Julio Montoya, 08/06/2012 12:38
admin.png (166 KB) admin.png Julio Montoya, 08/06/2012 12:38



Updated by Julio Bonifacio Aliaga about 8 years ago

  • % Done changed from 0 to 10

When making the documents tool icon visible, it is OK (the student view shows the Images directory in the documents listing - no error message). This behaviour is wrong, as hiding the documents tool should have no impact on accessing it (it only hides the icon). -- Yannick_ (using Julio B's account)


Updated by Julio Bonifacio Aliaga about 8 years ago

We tried the exercises tool, and its behaviour is good: when hidden, it is still accessible. Good. Only the documents tool is failing.


Updated by Julio Bonifacio Aliaga about 8 years ago

  • % Done changed from 10 to 30

The problem is at line 346 of document.php:

if ($tool_visibility == '0' && $to_group_id == '0' && !($is_allowed_to_edit || $group_member_with_upload_rights)) {

At line 345, the condition on tool_visibility == 0 is breaking the idea of being able to access the course. As the check is also on $to_group_id, we assume it is meant to be related to groups. Is there a reason for this condition? Could we remove it if it has nothing to do with groups?


Updated by Yannick Warnier about 8 years ago

  • Assignee set to Julio Montoya

Updated by Yannick Warnier about 8 years ago

  • Target version changed from 1.9 Beta to 1.9 RC1

Updated by Julio Montoya about 8 years ago

I can't reproduce the bug, maybe it was already fixed?

login as an admin/teacher all docs are invisible

login as an admin/teacher I clicked in the learner view

also when loading as a real student, he can access the document tool


Updated by Yannick Warnier almost 8 years ago

  • Status changed from Needs more info to Rejected - Abandoned

The problem seems to have disappeared, indeed.

Also available in: Atom PDF