public function addUsersToRoles($users, $roles, $main)
 {
     try {
         $array = AclQueryUtils::arraysRolesPermutations($users, $roles, $main);
         $res = \DB::table('acl_users_roles')->insert($array);
         return $res;
     } catch (\Exception $ex) {
         throw new AclQueryException('addUsersToRoles. ' . $ex->getMessage());
     }
 }
示例#2
0
 public function addUsersRoles($users, $roles, $main = 'N')
 {
     $users = AclQueryUtils::getIdsFromObjects($users);
     $roles = AclQueryUtils::getIdsFromObjects($roles);
     return $this->alters->addUsersToRoles($users, $roles, $main);
 }