Skip to content

Commit

Permalink
Merge pull request #680 from Peter253545/main
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
SuperManifolds authored Nov 5, 2024
2 parents 849842b + 533f7b8 commit 351843f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/classes/Anope.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ class Anope {
KILLPROTECT: 1,
MEMO_RECEIVE: 1,
MEMO_SIGNON: 1,
NS_NO_EXPIRE: 1,
NS_PRIVATE: 1,
NS_SECURE: 1,
display: nick,
Expand All @@ -472,6 +471,7 @@ class Anope {
vhost_creator: 'API',
vhost_time: createdUnixTime,
vhost_host: vhost,
NS_NO_EXPIRE: 1,
}).into('anope_db_NickAlias')

await transaction.commit()
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/Validators.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UnprocessableEntityAPIError } from '../classes/APIError'
import RegexLiteral from './RegexLiteral'


const forbiddenCMDRNameComponents = ['[pc]', '[xb]', '[ps]', 'CMDR']
const forbiddenCMDRNameComponents = ['[pc]', '[xb]', '[ps]', 'cmdr']
const requiredQuoteFields = [
'message',
'author',
Expand Down
2 changes: 1 addition & 1 deletion src/routes/APIResource.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export default class APIResource extends API {
return undefined
}

if (!Reflect.apply(changeRelationship.hasPermission, this, [ctx, entity, relationship.id])) {
if (!Reflect.apply(changeRelationship.hasPermission, this, [ctx, entity, data.id])) {
throw new ForbiddenAPIError({ pointer: '/data' })
}
return changeRelationship.patch({ entity, id: data.id, ctx, transaction })
Expand Down
4 changes: 2 additions & 2 deletions src/routes/Clients.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ export default class Clients extends APIResource {
if (relationship === 'user') {
return {
many: false,
hasPermission (connection, entity, id) {
return (!entity.userId && id === connection.state.user.id) || Permission.granted({
hasPermission (connection) {
return Permission.granted({
permissions: ['clients.write'],
connection,
})
Expand Down

0 comments on commit 351843f

Please sign in to comment.