<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <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 class="moz-txt-link-freetext" href="Model::getInstanceById($this">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.jq4bWdi8.3Mz4AM8C@vinsoft.it"
          alt="" moz-do-not-send="false" width="561" height="330"
          border="1"><br>
      </font></p>
    <p><font size="4">and it works as intended.</font></p>
    <p><font size="4">I will push a commit on code.vtiger.com 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 class="moz-cite-prefix">Il 28/01/25 17:38, Rubén A. Estrada
      Orozco ha scritto:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKjsHQ-1ewi5LQ60_0hxiKQjx-Y+bHwi2T_BFZ6fj=pHj5pmTA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Looks like a bug to me.<br>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2025 at
          8:35 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>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.SkOhIa4M.ckhk30Wu@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.ox44xBxn.qzUMQdWu@vinsoft.it" alt=""
                width="658" height="474" border="1" class=""><img
                src="cid:part4.mmBBrneR.hjwb4FtZ@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.iQ9S1s6u.r2cUuBiA@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.IW95CUHr.0N7U1uoM@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.kDf6od6C.U0xkJGj0@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.p3YRomlM.ETr0T0BV@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.9GwfleED.YAkphk0b@vinsoft.it"
              width="735" height="456" alt="" border="1" class=""><img
              src="cid:part10.ASlrCrm9.6kjvv0XU@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 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>