View Issue Details

IDProjectCategoryView StatusLast Update
0003581mantisbtbugtrackerpublic2005-04-18 10:40
Reporterprognase Assigned Tovwegert  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
PlatformUnixOSHP-UXOS VersionB.11.00
Product Version0.18.1 
Fixed in Version1.0.0a1 
Summary0003581: "Manage" menu item not consequently available for project managers
Description

If you are manager of at least one project and not having one of these selected as active, menu item 'Manage' is not available. However, when having a project selected you are responsible for, the menu item appears and links to list of projects to manage.

"Manage" should always be available and link to "manage_proj_page.php". Rule: activate in case you are responsible for at least one project.

Steps To Reproduce

Select project you are not responsible for - no "Manage" menu item; select a project you are responsible for, it appears.

TagsNo tags attached.
Attached Files
diff-3581.txt (2,428 bytes)   
diff -Naur mantis-cvs-orig/core/access_api.php mantis-cvs/core/access_api.php
--- mantis-cvs-orig/core/access_api.php	2005-03-15 19:21:40.000000000 +0100
+++ mantis-cvs/core/access_api.php	2005-03-15 23:24:14.914915528 +0100
@@ -257,6 +257,27 @@
 	}
 
 	# --------------------
+	# Check whether the user has the specified access level for any project project
+        function access_has_any_project( $p_access_level, $p_user_id = null ) {
+ 		# Short circuit the check in this case
+		if ( NOBODY == $p_access_level ) {
+			return false;
+		}
+
+		if ( null === $p_user_id ) {
+		    $p_user_id = auth_get_current_user_id();
+		}
+
+                $t_access = false;
+                $t_projects = project_get_all_rows();
+                foreach ( $t_projects as $t_project ) {
+                    $t_access = $t_access || access_has_project_level( $p_access_level, $t_project[id], $p_user_id );
+                }
+
+		return ( $t_access );
+        }
+
+	# --------------------
 	# Check the current user's access against the given value and return true
 	#  if the user's access is equal to or higher, false otherwise.
 	#
diff -Naur mantis-cvs-orig/core/html_api.php mantis-cvs/core/html_api.php
--- mantis-cvs-orig/core/html_api.php	2005-03-15 19:21:42.000000000 +0100
+++ mantis-cvs/core/html_api.php	2005-03-15 23:38:58.036660616 +0100
@@ -475,14 +475,14 @@
 
 				# Manage Users (admins) or Manage Project (managers) or Manage Custom Fields
 				$t_show_access = min( config_get( 'manage_project_threshold' ), config_get( 'manage_custom_fields_threshold' ), ADMINISTRATOR );
-				if ( access_has_project_level( $t_show_access ) ) {
+				if ( access_has_any_project( $t_show_access ) ) {
 					if ( access_has_project_level( ADMINISTRATOR ) ) {
 						$t_link = 'manage_user_page.php';
 					} else {
-						if ( access_has_project_level( config_get( 'manage_project_threshold' ) ) ) {
-							$t_link = 'manage_proj_page.php';
+						if ( access_has_project_level( config_get( 'manage_project_threshold' ) ) ) { 
+                                                        $t_link = 'manage_proj_edit_page.php?project_id=' . helper_get_current_project();
 						} else {
-							$t_link = 'manage_custom_field_page.php';
+						        $t_link = 'manage_proj_page.php';
 						}
 					}
 					$t_menu_options[] = "<a href=\"$t_link\">" . lang_get( 'manage_link' ) . '</a>';
diff-3581.txt (2,428 bytes)   

Relationships

related to 0005364 closedthraxisp Database field 'view_state' not found. 

Activities

vboctor

vboctor

2004-02-19 08:03

manager   ~0005057

The manage project page allows the manager to manage a specific project. If the user does not have access to manage the current project, which project should it open for management?

This is not the only feature that changes based on the current project. For example, if a user is a developer in one project and reporter in another, he/she will only see the "Assign To Me" button in the project whether the user is a developer.

prognase

prognase

2004-02-19 13:54

reporter   ~0005064

Should be straight forward with this. Haven't played with latest version a lot yet, but afaik the "Manage" link always goes to a list of projects the user is manager of - so no need to make this dependent on currently selected project at all.

Other option to implement could be:
(1) if manager of any project -> Make menu item available and
(1a) if manager of currently selected project -> link to manage this project
(1b) if not manager of currently selected project -> link to "manage_proj_page.php"
(2) Otherwise don't show "Manage"

epu

epu

2005-03-14 19:08

reporter   ~0009535

can't update issue (only new status appears in dropdown). Please assign or acknowledge.

vwegert

vwegert

2005-03-15 17:41

reporter   ~0009551

I've attached a patch that should implement the desired behaviour. Hopefully it's not too far off the coding standards, I'm still struggling with emacs :-)

vwegert

vwegert

2005-03-19 10:10

reporter   ~0009591

fixed in CVS

vwegert

vwegert

2005-03-23 16:32

reporter   ~0009647

new issue reported via IRC: after fresh install of CVS HEAD, manually created admin user is unable to see "manage" link

zariok

zariok

2005-03-23 16:35

reporter   ~0009648

Based off the new install.php/schema.php, the schema is built without adding a default user.

By using the following sql, I add an 'admin' user:

INSERT INTO m_user VALUES (1, 'admin', 'Administrator', 'admin', '21232f297a57a5a743894a0e4a801fc3', sysdate,sysdate, 1, 1, 90, 3, 0, 0, 'fsdfsdf')

With protected == 1, "My Account" is not visible changing this to 0 brings it visible.

"Manage" is NOT visible. I attempted to raise access_level to 100 to no avail.

All of this was attempted on a fresh schema running on Oracle 9i.

vwegert

vwegert

2005-03-23 17:07

reporter   ~0009651

once again, fixed in CVS