參考資料:https://docs.moodle.org/311/en/Private_files
moodle給每個用戶提供一個個人專用檔案空間,老師、學生存檔都非常方便。但是在測驗考試期間就變成了漏洞,怎麼將其臨時隱藏或關閉起來呢?
該功能對應的權限是:moodle/user:manageownfiles 和 repository/user:view
學生對應的角色是 student,將其moodle/user:manageownfiles 和 repository/user:view兩個權限禁用就可以了。參考下圖:
Preventing access to Private files
If you don't wish to use private files on your site, you can prevent access as follows:
- Log in as an admin and go to Site administration > Plugins > Repositories > Manage repositories and disable the Private files repository.
- Go to Site administration > Users > Permissions > Define Roles and edit the authenticated user role.
- Unset the capabilities moodle/user:manageownfiles and repository/user:view and save changes.
If you want teachers to be able to access private files but not students, then in addition to the above steps
- Go to Site administration > Users > Permissions > Define Roles and create a new role to be assigned in the system context.
- Allow the capabilities moodle/user:manageownfiles and repository/user:view and save changes.
- Assign teachers this new role as a system role.