How to set up ACLs to allow users to access only s

2019-05-25 21:28发布

I'm planning to use Loopback to create an application where users will be able to access only specific records.

Let's say we have a Projects model, with 2 records:

{
    "projects": [
        {
            "project_name": "foo",
            "project_start_date": "2012-10-29T18:25:43.511Z"
        },
        {
            "project_name": "bar",
            "project_start_date": "2012-10-30T18:25:43.511Z"
        }
    ]
}

and that I have 2 users, joe and katie.

I want joe to be able to access only project foo, and katie to be able to access only project bar.

Is this possible at all? If so, how should I go about setting up the ACLs?

2条回答
爷、活的狠高调
3楼-- · 2019-05-25 22:12

At the moment, the declarative ACL doesn't support your use case. You need to create afterRemote hook to further check the response. See http://docs.strongloop.com/display/LB/Remote+hooks.

查看更多
登录 后发表回答