From 57cd73b5a242375247294515ce1f7e8577f5ac37 Mon Sep 17 00:00:00 2001 From: FunCoder Date: Fri, 20 Dec 2024 08:49:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=8F=AA=E8=AF=BB=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/lang/en-us.ini | 1 + conf/lang/ru-ru.ini | 1 + models/Member.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/lang/en-us.ini b/conf/lang/en-us.ini index 33d4da30..5da39714 100644 --- a/conf/lang/en-us.ini +++ b/conf/lang/en-us.ini @@ -497,6 +497,7 @@ status = Status super_admin = Super administrator admin = Administrator user = User +read_usr = Read-Only User normal = Normal disable = Disable enable = Enable diff --git a/conf/lang/ru-ru.ini b/conf/lang/ru-ru.ini index 12fbc58e..ecacf587 100644 --- a/conf/lang/ru-ru.ini +++ b/conf/lang/ru-ru.ini @@ -497,6 +497,7 @@ status = Статус super_admin = Супер администратор admin = Администратор user = Пользователь +read_usr = Пользователи только для чтения normal = Нормальный disable = Отключено enable = Включено diff --git a/models/Member.go b/models/Member.go index 90139a4b..b3eb6264 100644 --- a/models/Member.go +++ b/models/Member.go @@ -475,7 +475,7 @@ func (m *Member) Valid(is_hash_password bool) error { if strings.Count(m.Description, "") > 500 { return ErrMemberDescriptionTooLong } - if m.Role != conf.MemberGeneralRole && m.Role != conf.MemberSuperRole && m.Role != conf.MemberAdminRole { + if m.Role != conf.MemberGeneralRole && m.Role != conf.MemberSuperRole && m.Role != conf.MemberAdminRole && m.Role != conf.MemberReaderRole { return ErrMemberRoleError } if m.Status != 0 && m.Status != 1 {