Ticket #3743 (closed enhancement: fixed)
[with patch; positive review] notebook -- allow admin user to view any worksheet
| Reported by: | TimothyClemans | Owned by: | boothby |
|---|---|---|---|
| Priority: | major | Milestone: | sage-3.1 |
| Component: | notebook | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
User "admin" will be able to go to hostname/users and click on any listed user and have complete access to that user's worksheets.
Attachments
Change History
comment:1 Changed 5 years ago by TimothyClemans
- Summary changed from notebook -- allow admin user to view any worksheet to [with patch, needs review] notebook -- allow admin user to view any worksheet
comment:2 Changed 5 years ago by was
- Summary changed from [with patch, needs review] notebook -- allow admin user to view any worksheet to [with patch, needs work] notebook -- allow admin user to view any worksheet
- Milestone set to sage-3.1.1
REFEREE REPORT:
You determine whether a user is an admin with
if self.username == 'admin'
It would be better to determine whether a user is an admin by using the account_type() method of users. This is because a user with a username other than 'admin' can still be an admin; with the code you've written you would introduce a bug since suddenly certain admin-like things wouldn't work for such a user, but they should.
comment:3 Changed 5 years ago by TimothyClemans
I started out using user_type but for whatever reason for user admin it was returning 'user' so to get the functionality working at all I used the current work around.
comment:4 Changed 5 years ago by TimothyClemans
- Summary changed from [with patch, needs work] notebook -- allow admin user to view any worksheet to [with patch, needs review] notebook -- allow admin user to view any worksheet

