Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SugarFolders.php Re:277 #281

Open
wants to merge 2 commits into
base: hotfix
Choose a base branch
from

Conversation

pstevens71
Copy link

These changes are necessary to fix multiple problems with group folders display for users. Fix isgroup vs is_group error. Test if user has access to the group folder, ensure admin always sees the group folders in the arrays, and to remove child folders from the array as well as check for and manage duplicates so folders don't appear twice.

This change is for 7.13+

Description

Motivation and Context

How To Test This

This change is required in conjunction with a few others. See #277 I'll add a complete list of changes. User will be able to add group folders if they are given access via security group. Admin will see all folders.

NOTE: in conjunction with other changes, it will be necessary to re-save group inbound accounts. This is necessary so that the folders get properly marked as "is_group=1"

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • [x ] My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • [ x] I have read the How to Contribute guidelines.

These changes are necessary to fix multiple problems with group folders display for users. Fix isgroup vs is_group error.  Test if user has access to the group folder, ensure admin always sees the group folders in the arrays, and to remove child folders from the array as well as check for and manage duplicates so folders don't appear twice.

This change is for 7.13+
missed line 889 in my original submission.
@pstevens71
Copy link
Author

Not sure how to resolve the conflict? This part is correct:

<<<<<<< patch-2
          $isGroup = $item['is_group'] ?? '';
            if ($isGroup == 1) {
                //added check if user has access to the inbound account, OR is admin and also check for duplicates
                if ((isset($userAccessibleInboundIds[$item['id']]) || is_admin($user)) && !in_array($item['id'], $groupFolderIdsAdded)) {
=======

It has to check if the user either created the account, is admin, or if the user has access to the security group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant