<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font size="4">Merge request subtitted</font></p>
    <p><font size="4"><a class="moz-txt-link-freetext" href="https://code.vtiger.com/vtiger/vtigercrm/-/merge_requests/1267">https://code.vtiger.com/vtiger/vtigercrm/-/merge_requests/1267</a></font></p>
    <p><font size="4">V.<br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <div class="moz-cite-prefix">Il 28/01/25 19:09, Rubén A. Estrada
      Orozco ha scritto:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKjsHQ9og_KreSGXCT16i08dZkOWT52mVW=WyAqYewSXB5yjTg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Thanks for that Vicenzo. It's good to know what you
        discovered and great to have the additional feature.<br>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2025 at
          11:06 AM Vincenzo Bruno <<a
            href="mailto:v.bruno@vinsoft.it" moz-do-not-send="true"
            class="moz-txt-link-freetext">v.bruno@vinsoft.it</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p><font size="4">My team investigated furter and it's a 
                feature.....</font></p>
            <p><font size="4">The option "Users having Same Role or
                Subordinate Role"  calls the function</font></p>
            <p><b><font size="4">public function get<u>SameLevel</u>UsersWithSubordinates(){</font></b></p>
            <p><font size="4">$currentUserRoleModel =
                Settings_Roles_Record_<a moz-do-not-send="true">Model::getInstanceById($this</a>->getRole());<br>
                        $sameLevelRoles = $currentUserRoleModel-><b>getSameLevelRoles()</b>;<br>
                        $sameLevelUsers = $this-><b>getAllUsersOnRoles($sameLevelRoles)</b>;<br>
                        $subordinateUsers =
                $this->getRoleBasedSubordinateUsers();<br>
                        foreach ($subordinateUsers as $userId =>
                $userName) {<br>
                            $sameLevelUsers[$userId] = $userName;<br>
                        }<br>
                        return $sameLevelUsers;<br>
                    }<br>
              </font></p>
            <p><font size="4">in modules/Users/models/Record.php</font></p>
            <p><font size="4"><br>
              </font></p>
            <p><font size="4">The solution isn't complex</font></p>
            <p><font size="4">we created the function
                getSameRolelUsersWithSubordinates()</font></p>
            <p><font size="4">renamed </font><font size="4">"Users
                having Same Role or Subordinate Role" -> </font><font
                size="4">"Users having Same Level or Subordinate Role"</font></p>
            <p><font size="4">and added a new option in the Role form:</font></p>
            <p><font size="4"><img
                  src="cid:part1.0UD60Q0q.T0Iuz0id@vinsoft.it" alt=""
                  width="561" height="330" border="1" class=""><br>
              </font></p>
            <p><font size="4">and it works as intended.</font></p>
            <p><font size="4">I will push a commit on <a
                  href="http://code.vtiger.com" target="_blank"
                  moz-do-not-send="true">code.vtiger.com</a> in the next
                hours<br>
              </font></p>
            <p><font size="4">Any comment on this new feature is
                appreciated<br>
              </font></p>
            <p><font size="4">Bye for now</font></p>
            <p><font size="4">Vincenzo<br>
              </font></p>
            <p><font size="4"><br>
              </font></p>
            <div>Il 28/01/25 17:38, Rubén A. Estrada Orozco ha scritto:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Looks like a bug to me.<br>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2025
                  at 8:35 AM Vincenzo Bruno <<a
                    href="mailto:v.bruno@vinsoft.it" target="_blank"
                    moz-do-not-send="true" class="moz-txt-link-freetext">v.bruno@vinsoft.it</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                  <div>
                    <p>Hi vtigers,</p>
                    <p>I have a problem on users visibility based on
                      "Can Assign Records To" role configuration.</p>
                    <p>I have a fresh VT 8.3 install and created 2 sales
                      roles, SP1 and SP2,  as in the picture:</p>
                    <img src="cid:part2.6ImuOOgD.QivZdFiz@vinsoft.it"
                      alt="" width="626" height="471" border="1"
                      class="">
                    <p>SP1 and SP2 have  "Can Assign Records To" on 
                      "Users having Same Role or Subordinate Role"</p>
                    <p><img src="cid:part3.lfSStCAX.mKEHujlj@vinsoft.it"
                        alt="" width="658" height="474" border="1"
                        class=""><img
                        src="cid:part4.0XsT0K0I.m3geR0nF@vinsoft.it"
                        width="658" height="473" alt="" border="1"
                        class=""></p>
                    <p>I removed all precofigured Groups, there are no
                      groups in the installed VT.<br>
                    </p>
                    <p>I then created 3 users in the 2 roles:<br>
                    </p>
                    <p><br>
                    </p>
                    <img src="cid:part5.tTXrDS00.qUbx37gx@vinsoft.it"
                      alt="" width="814" height="567" border="1"
                      class="">
                    <p>Then I created 2 contacts for each role <br>
                    </p>
                    <p><img src="cid:part6.UZVnCKRO.5DUVqZY7@vinsoft.it"
                        alt="" width="811" height="386" border="1"
                        class=""></p>
                    <p>Sharing rules of Contacts module set on Private
                      and inter-role visibility enabled:</p>
                    <img src="cid:part7.d3WXPSp4.zyJrXMU5@vinsoft.it"
                      width="811" height="397" alt="" border="1"
                      class="">
                    <p><br>
                    </p>
                    <p>Entity visibility works as expected:<br>
                    </p>
                    <p><img src="cid:part8.pfur38xq.A1wpYy0P@vinsoft.it"
                        width="809" height="502" alt="" border="1"
                        class=""></p>
                    <p><br>
                    </p>
                    <p>The problem is on "Can Assign Records To" = 
                      "Users having Same Role or Subordinate Role"</p>
                    <p>because user of SP1 can assign to users of SP2
                      and vice-versa</p>
                    <img src="cid:part9.elO3hou6.bNeBGD8b@vinsoft.it"
                      width="735" height="456" alt="" border="1"
                      class=""><img
                      src="cid:part10.5WeVriz1.kKj1vfii@vinsoft.it"
                      width="736" height="457" alt="" border="1"
                      class="">
                    <p><br>
                    </p>
                    <p>SP1 and SP2 are not the "Same Role" nor a
                      "Subordinate Role". I see them as "Same level
                      role", sharing the same parent Role.<br>
                    </p>
                    <p>I tried in different installs obtaining the same
                      behaviuor.</p>
                    <p>Is this a bug or an intended feature? <br>
                    </p>
                    <p>How can I solve this issue?<br>
                    </p>
                    <p>Thank you</p>
                    <p>Vincenzo<br>
                    </p>
                    <p><br>
                    </p>
                    <p><br>
                    </p>
                    <p><br>
                    </p>
                    <p><br>
                    </p>
                    <p><br>
                    </p>
                    <p><br>
                    </p>
                    <p><br>
                    </p>
                  </div>
                  _______________________________________________<br>
                  <a href="http://www.vtiger.com/" rel="noreferrer"
                    target="_blank" moz-do-not-send="true"
                    class="moz-txt-link-freetext">http://www.vtiger.com/</a></blockquote>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
<a href="http://www.vtiger.com/" target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">http://www.vtiger.com/</a></pre>
            </blockquote>
            <pre cols="72">-- 
Vincenzo Bruno
Coopyleft - <a href="http://www.coopyleft.it" target="_blank"
            moz-do-not-send="true">www.coopyleft.it</a>
tel: 3287252923
Digital Polis (<a href="http://www.digitalpolis.it" target="_blank"
            moz-do-not-send="true">www.digitalpolis.it</a>)
Hacklab Cosenza (<a href="http://www.hlcs.it" target="_blank"
            moz-do-not-send="true">www.hlcs.it</a>)
    
</pre>
          </div>
          _______________________________________________<br>
          <a href="http://www.vtiger.com/" rel="noreferrer"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">http://www.vtiger.com/</a></blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
<a class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Vincenzo Bruno
Coopyleft - <a class="moz-txt-link-abbreviated" href="http://www.coopyleft.it">www.coopyleft.it</a>
tel: 3287252923
Digital Polis (<a class="moz-txt-link-abbreviated" href="http://www.digitalpolis.it">www.digitalpolis.it</a>)
Hacklab Cosenza (<a class="moz-txt-link-abbreviated" href="http://www.hlcs.it">www.hlcs.it</a>)
    
</pre>
  </body>
</html>