OptimalBits / node_acl

Access control lists for node applications
2.62k stars 369 forks source link

Can I user roles as UserId Question? #237

Open kethan opened 7 years ago

kethan commented 7 years ago

Hi,

Can I use userId in the roles field because I want user-specific ACL or is there any other better way to do that?

{
        roles:['123e4567-e89b-12d3-a456-426655440000'],
        allows:[
            {resources:'blogs', permissions:'get'},
            {resources:['forums', 'news'], permissions:['get', 'put', 'delete']}
        ]
    }
c3s4r commented 7 years ago

I had the same question, but I found the answer in the documentation. 3rd paragraph:

Sometimes it may even be useful to create one role per user, to get the finest granularity possible

So I guess your approach is possible. Anyways, I don't know what the performance will be, specially if you have thousands of users. Does anyone has information on that? @manast?

n-sviridenko commented 4 years ago

Same question.