gburtini/PHP-ACL — reverse-engineered prompt
Reverse engineered prompt
Build me a small PHP package for user login and permissions. I want it to handle signing users in, remembering them with secure signed and encrypted cookies, and deciding what they can access based on roles like administrator, manager, client, and guest.
Please make it easy to plug in a custom authenticator later, so someone could check usernames and passwords against a database, but include a very simple demo authenticator just to show the flow. I also want an ACL system where I can define roles and resources, set allow and deny rules, support role inheritance, and optionally run custom checks using extra arguments like a user ID or file ID.
Add a User class that ties everything together with login, expiration, current identity, logged in status, roles, and simple permission checks. It should be lightweight, easy to extend, and ready to use in a normal Composer based PHP project. Include a clear example showing setup and basic usage. Look up current PHP docs online if you need to.
Want more depth? Deep Reverse