(user, mode)
| 154 | } |
| 155 | |
| 156 | async getError (user, mode) { |
| 157 | const cacheKey = `${mode}-${user}` |
| 158 | // TODO ?? add to can: req.method and resourceExists. Actually all tests pass |
| 159 | this.aclCached[cacheKey] = this.aclCached[cacheKey] || this.can(user, mode) |
| 160 | const isAllowed = await this.aclCached[cacheKey] |
| 161 | return isAllowed ? null : this.messagesCached[cacheKey].reduce((prevMsg, msg) => msg.status > prevMsg.status ? msg : prevMsg, { status: 0 }) |
| 162 | } |
| 163 | |
| 164 | static getDirectory (aclFile) { |
| 165 | const parts = aclFile.split('/') |
no test coverage detected