Delete currently logged-in Project should be restricted

Registered by Removed by request

Summary
=======
Popup a warning message when project owner intentionally or inadvertently delete currently logged-in project at /projects/ page(See screenshot of this page: http://imgur.com/I3qcgbH).

Motivation
========
Deleting currently logged-in project by project owner with admin role, is a potentially destructive operation that can render the environment inoperable. So showing a warning popup message and restricting the delete opration, can inform the project owner about this destruction action.

Description
=========
When project owner with administration role, select his currently logged-in project in the project list at project index page (/admin/projects), and click on the delete projects action, then two warnning and error messages should be shown with the following contents:
- Warning message: “You can't delete currently logged-in project: % project_name”
- Error message: “unable to delete % project_name project"
Finally the user(with administration role) restricted to doing delete operation. Also message should be logged at log file.
Warning message is shown to inform user that you can't do this operation.
Error message is shown to inform user that the delete operation is not done successfully and the selected project is not deleted.

UX
===
Screenshot: https://www.dropbox.com/s/asvu1yl04nhqw2i/Projects%20-%20OpenStack%20Dashboard%20%282%29.png?dl=0

Testing
======
1- Go to /admin/projects/ page
2- Select the project that you currently logged-in with
3- Click on the 'delete project' button
4- Click on the yes button to do delete action
5- As you see, both wanning and error messages are shown.
6. Error message is logged. So you can check the log files.

Outside Dependencies
==================
N/A

Requirements Update Required
=======
N/A

Doc Impact
=========
N/A
 _

Blueprint information

Status:
Complete
Approver:
David Lyle
Priority:
Low
Drafter:
Removed by request
Direction:
Approved
Assignee:
hossein zabolzadeh
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
hossein zabolzadeh
Completed by
hossein zabolzadeh

Whiteboard

[Amit Ugol] wrote: Under /admin/projects/ (http://imgur.com/I3qcgbH) an administrator can disable a project altogether, even Admin itself. This is a potentially destructive operation that can render the environment inoperable. A pop-up here explaining that this step is destructive and potentially harmful would serve some protection.
------------------------------------

[Zabolzadeh] wrote: I ran latest version of horizon, and this problem is resolved by dis-allowing admin user to disable "Admin" project(When mouse hover to the enable checkbox, cursor changed to 'stopped' and dis-allow admin to change the current project state from enable to disable with a fairly inteligible warning message).
But in the case of deleting admin project, Yes, it done without any protection which needs a warnning popup message as you said.
I am willing to implement it.

Gerrit topic: https://review.openstack.org/#q,topic:bp/project-disabling-warning,n,z

Addressed by: https://review.openstack.org/199410
    Implements: blueprint project-disabling-warning

[mrunge, Oct 09 2105]
this approach completely fails, when an admin removes a currently logged in user from his project.

https://bugs.launchpad.net/horizon/+bug/1297130
https://bugs.launchpad.net/horizon/+bug/1166585

I think, this is more a bug that a blueprint.

[Zabolzadeh Saturday October 10 2015]
The following patch better address the issue, and solves the problem:
https://review.openstack.org/#/c/142481/

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.