(acl, user, req)
| 132 | |
| 133 | // Gets the permissions string for the given user and resource |
| 134 | async function getPermissionsFor (acl, user, req) { |
| 135 | const accesses = MODES.map(mode => acl.can(user, mode)) |
| 136 | const allowed = await Promise.all(accesses) |
| 137 | return PERMISSIONS.filter((mode, i) => allowed[i]).join(' ') |
| 138 | } |