Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
ba6959b8
Commit
ba6959b8
authored
3 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
fix(api): 管理者およびモデレーターをブロックできてしまう問題を修正
parent
91c9a639
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/server/api/endpoints/blocking/create.ts
+10
-0
10 additions, 0 deletions
src/server/api/endpoints/blocking/create.ts
with
11 additions
and
0 deletions
CHANGELOG.md
+
1
−
0
View file @
ba6959b8
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
-
クライアント: ヘッダーのタブが折り返される問題を修正
-
クライアント: ヘッダーのタブが折り返される問題を修正
-
クライアント: ヘッダーにタブが表示されている状態でタイトルをクリックしたときにタブ選択が表示されるのを修正
-
クライアント: ヘッダーにタブが表示されている状態でタイトルをクリックしたときにタブ選択が表示されるのを修正
-
クライアント: ユーザーページのタブが機能していない問題を修正
-
クライアント: ユーザーページのタブが機能していない問題を修正
-
API: 管理者およびモデレーターをブロックできてしまう問題を修正
## 12.91.0 (2021/09/22)
## 12.91.0 (2021/09/22)
...
...
This diff is collapsed.
Click to expand it.
src/server/api/endpoints/blocking/create.ts
+
10
−
0
View file @
ba6959b8
...
@@ -43,6 +43,12 @@ export const meta = {
...
@@ -43,6 +43,12 @@ export const meta = {
code
:
'
ALREADY_BLOCKING
'
,
code
:
'
ALREADY_BLOCKING
'
,
id
:
'
787fed64-acb9-464a-82eb-afbd745b9614
'
id
:
'
787fed64-acb9-464a-82eb-afbd745b9614
'
},
},
cannotBlockModerator
:
{
message
:
'
Cannot block a moderator or an admin.
'
,
code
:
'
CANNOT_BLOCK_MODERATOR
'
,
id
:
'
8544aaef-89fb-e470-9f6c-385d38b474f5
'
}
},
},
res
:
{
res
:
{
...
@@ -60,6 +66,10 @@ export default define(meta, async (ps, user) => {
...
@@ -60,6 +66,10 @@ export default define(meta, async (ps, user) => {
throw
new
ApiError
(
meta
.
errors
.
blockeeIsYourself
);
throw
new
ApiError
(
meta
.
errors
.
blockeeIsYourself
);
}
}
if
(
user
.
isAdmin
||
user
.
isModerator
)
{
throw
new
ApiError
(
meta
.
errors
.
cannotBlockModerator
);
}
// Get blockee
// Get blockee
const
blockee
=
await
getUser
(
ps
.
userId
).
catch
(
e
=>
{
const
blockee
=
await
getUser
(
ps
.
userId
).
catch
(
e
=>
{
if
(
e
.
id
===
'
15348ddd-432d-49c2-8a5a-8069753becff
'
)
throw
new
ApiError
(
meta
.
errors
.
noSuchUser
);
if
(
e
.
id
===
'
15348ddd-432d-49c2-8a5a-8069753becff
'
)
throw
new
ApiError
(
meta
.
errors
.
noSuchUser
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment