How are you handling user permissions in more complex projects?

I know you can’t share the real code. But if you could write a blog on this complex problem and explain the small nitty grits and share some example code snippets so as to make it easy to understand for a beginner. Maybe a complex invoice approval system, or long leave approvals in the HRMS (Human resource management system). Or any other thing.

But I truly appreciate that you have given a enough picture here itself, I will read it like few times to grasp the idea.

Thanks