Ticket #3743 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

[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

sage-3743.patch Download (2.9 KB) - added by TimothyClemans 5 years ago.
sage-3743_2.patch Download (2.4 KB) - added by TimothyClemans 5 years ago.

Change History

Changed 5 years ago by TimothyClemans

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.

Changed 5 years ago by TimothyClemans

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

comment:5 Changed 5 years ago by was

  • Summary changed from [with patch, needs review] notebook -- allow admin user to view any worksheet to [with patch; positive review] notebook -- allow admin user to view any worksheet
  • Milestone changed from sage-3.1.1 to sage-3.1

Positive review

comment:6 Changed 5 years ago by mabshoff

  • Status changed from new to closed
  • Resolution set to fixed

Merged both patches in Sage 3.1.alpha1

Note: See TracTickets for help on using tickets.