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

Current user groups are used instead of "created by" groups when they differ #10545

Open
SinergiaCRM opened this issue Oct 7, 2024 · 0 comments
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact Type: Bug Bugs within the core SuiteCRM codebase Type:Suggestion Issue containing a suggestion of functionality, process or UI. Associated PRs are called enhancement

Comments

@SinergiaCRM
Copy link
Contributor

SinergiaCRM commented Oct 7, 2024

Issue

When a record is created on behalf of a user different from the current users, groups from current user are used.
Example: when an entry point which does not require authentication creates a record setting a creator different from the user used in the entry point, the groups taken by the created record are not the ones from the creator indicated but from the user used.

Possible Fix

No response

Steps to Reproduce the Issue

1.Create an entry-point which does not require authentication, sets its user to system user and create a record
`
<?php
if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}

global $current_user;
$current_user->getSystemUser();

$bean = BeanFactory::newBean('Contacts');
$bean->first_name = 'Test';
$bean->last_name = 'EP1';
$bean->set_created_by = false;
$bean->created_by = 'XXXXX-XXXXX-XXXXX'; // ID of a different user with different groups
$bean->save();
`
2.Check that the created record has the system user groups instead of the groups from the user indicated.

Context

No response

Version

7

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

MAriaDB, PHP 7.4

Operating System and Version

Debian

@SinergiaCRM SinergiaCRM added the Type: Bug Bugs within the core SuiteCRM codebase label Oct 7, 2024
@SinergiaCRM SinergiaCRM changed the title Current user groups are used instead of "created by" groups when the differ Current user groups are used instead of "created by" groups when they differ Oct 7, 2024
@johnM2401 johnM2401 added Type:Suggestion Issue containing a suggestion of functionality, process or UI. Associated PRs are called enhancement Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact labels Oct 8, 2024
enricsinergia pushed a commit to SinergiaTIC/SuiteCRM that referenced this issue Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact Type: Bug Bugs within the core SuiteCRM codebase Type:Suggestion Issue containing a suggestion of functionality, process or UI. Associated PRs are called enhancement
Projects
None yet
Development

No branches or pull requests

2 participants