I'm designing a course management system which has different kinds of users, including sysadmin, branch manager and branch user. As you might expect, the sysadmin can manage all records, the branch manager can manage all records from its branch and the branch user can only manage its records.
My question is, where should this filtering be done? Should I do it at the DAL layer? Or just return all records from the DAL and then do the filtering at some other layer? I've been looking everywhere for best practices regarding authorization but I haven't found anything that explains this aspect clearly.
Thanks.