2013/11/9 Jelle <jml@orkz.net>
Hi,

I know this is the Polish list, but I'm asking here because I get no replies on the English list. I hope this is okay.

Hello there,
yes there is low or no traffic on English groups. Feel free to ask here.
 


I want the user that I created in LMS to have ONLY privilege over the customergroups I selected for that user. Is that possible?


If i see it correctly:

"messageadd.php"

  $recipients = $DB->GetAll('...
[...]
  FROM customersview c
[..]
                .($customergroup ? ' AND c.id IN (SELECT customerid FROM customerassignments
                        WHERE customergroupid = '.intval($customergroup).')' : '')
[...]

and:


CREATE VIEW customersview AS
SELECT c.* FROM customers c
        WHERE NOT EXISTS (
                SELECT 1 FROM customerassignments a
                JOIN excludedgroups e ON (a.customergroupid = e.customergroupid)
                WHERE e.userid = lms_current_user() AND a.customerid = c.id);


So, it should (at least - in pgsql, have little to none with current mysql development in lms) work as you have expected.
If you could reproduce different behavior with some test data, then we should see.

Simply - the customerview - is a table with the customers only from 'allowed' groups for current logged user. And - data is taken from this table, as shown above. Second "WHERE" statement, selects groups, in case you have access to more groups, but want to send message only for some of them. 

Best Regards,