mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-06-28 15:45:35 +08:00
验证只读用户权限
This commit is contained in:
parent
81a3a5b32d
commit
57cd73b5a2
@ -497,6 +497,7 @@ status = Status
|
|||||||
super_admin = Super administrator
|
super_admin = Super administrator
|
||||||
admin = Administrator
|
admin = Administrator
|
||||||
user = User
|
user = User
|
||||||
|
read_usr = Read-Only User
|
||||||
normal = Normal
|
normal = Normal
|
||||||
disable = Disable
|
disable = Disable
|
||||||
enable = Enable
|
enable = Enable
|
||||||
|
@ -497,6 +497,7 @@ status = Статус
|
|||||||
super_admin = Супер администратор
|
super_admin = Супер администратор
|
||||||
admin = Администратор
|
admin = Администратор
|
||||||
user = Пользователь
|
user = Пользователь
|
||||||
|
read_usr = Пользователи только для чтения
|
||||||
normal = Нормальный
|
normal = Нормальный
|
||||||
disable = Отключено
|
disable = Отключено
|
||||||
enable = Включено
|
enable = Включено
|
||||||
|
@ -475,7 +475,7 @@ func (m *Member) Valid(is_hash_password bool) error {
|
|||||||
if strings.Count(m.Description, "") > 500 {
|
if strings.Count(m.Description, "") > 500 {
|
||||||
return ErrMemberDescriptionTooLong
|
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
|
return ErrMemberRoleError
|
||||||
}
|
}
|
||||||
if m.Status != 0 && m.Status != 1 {
|
if m.Status != 0 && m.Status != 1 {
|
||||||
|
Loading…
Reference in New Issue
Block a user