I'm creating a DAL for use in multiple applications, but I'm not providing any authorization or authentication to verify that the calling application has the permissions to execute the DAL and access the data i.e. making sure the user only sees the information they are allowed to see, to me this is the responsibility of the business layer to determine those rules. Ultimately I want to share this library between Web and desktop applications, but once the DAL library reaches the desktop I don't want a user taking the DAL and getting unrestricted access to the data the DAL provides.
Is there a way to ensure that the calling application is an approved application? I would like to avoid a key or password that is passed through each function or class creation. Ideally I would like some application level way of the DAL knowing that the application is a trusted one and can execute the code.
This is probably far fetched but I was hoping maybe there were some creative ideas on how to solve the problem or maybe I need to address the issue a different way.