Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Pleroma
pleroma
Merge requests
!508
[
#394
] User tags
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[
#394
] User tags
i1t/pleroma:394_user_tags
into
develop
Overview
14
Commits
7
Pipelines
7
Changes
10
Merged
Ivan Tashkinov
requested to merge
i1t/pleroma:394_user_tags
into
develop
6 years ago
Overview
13
Commits
7
Pipelines
7
Changes
10
Expand
Fixes
#394 (closed)
Edited
6 years ago
by
Ivan Tashkinov
2
0
Merge request reports
Compare
develop
version 6
6ed5044c
6 years ago
version 5
7a2162bb
6 years ago
version 4
abbf347d
6 years ago
version 3
7bcb6a18
6 years ago
version 2
22830c8f
6 years ago
version 1
7b194873
6 years ago
develop (base)
and
latest version
latest version
1cea97df
7 commits,
6 years ago
version 6
6ed5044c
6 commits,
6 years ago
version 5
7a2162bb
5 commits,
6 years ago
version 4
abbf347d
4 commits,
6 years ago
version 3
7bcb6a18
3 commits,
6 years ago
version 2
22830c8f
2 commits,
6 years ago
version 1
7b194873
1 commit,
6 years ago
10 files
+
168
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
lib/pleroma/web/admin_api/admin_api_controller.ex
+
12
−
0
Options
@@ -3,6 +3,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
alias
Pleroma
.
{
User
,
Repo
}
alias
Pleroma
.
Web
.
ActivityPub
.
Relay
import
Pleroma
.
Web
.
ControllerHelper
,
only:
[
json_response:
3
]
require
Logger
action_fallback
(
:errors
)
@@ -40,6 +42,16 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|>
json
(
new_user
.
nickname
)
end
def
tag_users
(
conn
,
%{
"nicknames"
=>
nicknames
,
"tags"
=>
tags
})
do
with
{
:ok
,
_
}
<-
User
.
tag
(
nicknames
,
tags
),
do
:
json_response
(
conn
,
:no_content
,
""
)
end
def
untag_users
(
conn
,
%{
"nicknames"
=>
nicknames
,
"tags"
=>
tags
})
do
with
{
:ok
,
_
}
<-
User
.
untag
(
nicknames
,
tags
),
do
:
json_response
(
conn
,
:no_content
,
""
)
end
def
right_add
(
conn
,
%{
"permission_group"
=>
permission_group
,
"nickname"
=>
nickname
})
when
permission_group
in
[
"moderator"
,
"admin"
]
do
user
=
User
.
get_by_nickname
(
nickname
)
Loading