View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003581 | mantisbt | bugtracker | public | 2004-02-19 05:50 | 2005-04-18 10:40 |
| Reporter | prognase | Assigned To | vwegert | ||
| Priority | normal | Severity | tweak | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | Unix | OS | HP-UX | OS Version | B.11.00 |
| Product Version | 0.18.1 | ||||
| Fixed in Version | 1.0.0a1 | ||||
| Summary | 0003581: "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. | ||||
| Tags | No 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>';
| ||||
|
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. |
|
|
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: |
|
|
can't update issue (only new status appears in dropdown). Please assign or acknowledge. |
|
|
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 :-) |
|
|
fixed in CVS |
|
|
new issue reported via IRC: after fresh install of CVS HEAD, manually created admin user is unable to see "manage" link |
|
|
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. |
|
|
once again, fixed in CVS |
|