How to show only projects which user has access

9 years 10 months ago #1 by dmartel
In "Create an Issue", how can we show only projects which user has access in the combobox?

We have added a project and a user whose group do not have access to the project. But the project is shown in the combobox anyway.

Thank you.

David

Please Log in or Create an account to join the conversation.

9 years 10 months ago - 9 years 10 months ago #2 by chrisc
That is currently an open change request, which is on the list of things to do.

The projects list in the dropdown is built solely from the list of published projects.

In theory its easy to implement, BUT there has to be an allowance for guest users as well which complicates it all, hence the delay in implementation. Sorry.

How were you associating user groups to specific projects?

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

9 years 5 months ago #3 by Thomas
I'm picking up this topic 'cause i have the same problem / question....

I want to configure a project that it is only visible by users / groups with the correct access.
For Example:
I have 2 groups ("group-A" and "group-B"), and 2 Projects ( "Project-1" and "Project-2).
Project-1 should only be visible for group-A, but not for group-B.
And Projekt-2 should only be visible for group-B, but not for group-A.

In reality i have of course more groups and more projects. But the 1:1 is always the same.

Is a configuration like that possible? and how?

Greetz
Thomas

Please Log in or Create an account to join the conversation.

9 years 5 months ago - 9 years 5 months ago #4 by chrisc
I think I can see the problem. I need to add some additional checks in the query that produces the drop down list.
Will test out a solution today after I have tested it to make sure there are no adverse effects. It should be a simple change.

Edit the file administrator/components/com_issuetracker/models/fields/issuetrackerprojectfe.php.

Change the code (starting at line 63) so that it looks like the following:
      if ( $isadmin == 0 ) {
         $query .= ' WHERE a.state = 1 ';
      } else {
         $query .= ' WHERE a.state in (0,1) ';
      }
      
      $groups  = implode(',', $user->getAuthorisedViewLevels());
      $query  .= ' AND a.access IN ('.$groups.')';

      $query .= ' ORDER BY a.lft';

We have added the following two lines after line 67..
      $groups  = implode(',', $user->getAuthorisedViewLevels());
      $query  .= ' AND a.access IN ('.$groups.')';

Tested it out and it seems to resolve the problem and only displays projects for the groups to which the user is allocated.

Update: Have implemented the above in the 1.6.5 release, for when it is released. If you could also confirm that it works for you that would be useful.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

9 years 5 months ago #5 by Thomas
not really. May i do something wrong?...

I've changed the file as you command.
When i'm editing the project in the Joomla-Administrator-Area under Components > Issue Tracker > Projects, i can't see an option to limit the view to an specific group. I tried it with to different setting under the tab "Issue Permissions" that only group1 can see this project.

But whatever my configurations are... on the homepage, logged in as user from group2, on a menu item type "List all Projects" i really can see all, but with this user i shouldn't see the that project1.

Do i something wrong?

Greets
Thomas

Please Log in or Create an account to join the conversation.

9 years 5 months ago - 9 years 4 months ago #6 by chrisc
It is the users that are in the different groups,not the project. That would explain why you do not appear to see the difference.

If the project is within an access group that the user can see, then it would be visible.

Try something very simplistic as a test.

For example if we make one project visible only to registered users, if we try and create an issue as a guest user (i.e. not logged in) then that specific project would not be visible in the dropdown list. By default a project would be visible to teh 'public'access group.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

Time to create page: 0.156 seconds
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries