OptimalBits / node_acl

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

long resources name problem #242

Closed sinqinc closed 7 years ago

sinqinc commented 7 years ago

Hi,

I don't know if i have a wrong design pattern for my ACL but I'm hitting a limit of mongo while creating my Roles.

The api is designed like that : id = UUID from mongo /org/:id_org/ou/:id_ou/project/:id_project/section/:id_section/variable/:id_variable/value/:id_value

So I'm adding Resources like that

"roles": "org_58829f092c8db0000ab91f5e_ou_58e7d95360b2ed001b8af1b1_admin",
    "allows": [
        { "resources": "/oragnization/58829f092c8db0000ab91f5e/ou/58e7d95360b2ed001b8af1b1", "permissions": ["GET","POST","PUT","DELETE"] }
        ]

each level may have admin or user to gain access to lower resources.

The problem is I'm getting a mongo error if I add a project ACL. Unhandled rejection MongoError: namespace name generated from index name "ubasev1.acl_allows_/oragnization/58829f092c8db0000ab91f5e/ou/58e7d95360b2ed001b8af1b1/project/591a81a55bd888000f30f765.$_bucketname_1_key_1" is too long (127 byte max)

sinqinc commented 7 years ago

using singleCollection seems to fix the problem.

Thank you