I am writing an application and I want to restrict access to certain behaviours/actions based on a users role.

I have searched online for a C++ library that implements this - or at least a guideline on how to "roll my own" - to no avail. Is anyone aware of such a library?. If no, I would be grateful for some ideas on how best to implement such a library/framework.

有帮助吗?

解决方案

Roles can be implemented as simple boolean (or binary) flags. Just check if the user has the flag set before performing some action.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top