Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
practical_train
Commits
04355d28
"src/git@gitlab.ruzhoukj.com:wujipeng/pipeline-network.git" did not exist on "9c5d4443d497e62827fb67f15d5e6c56d71baab1"
Commit
04355d28
authored
Aug 11, 2026
by
wujipeng
Browse files
教师端-教学管理-教案管理
parent
98e0a708
Changes
1
Show whitespace changes
Inline
Side-by-side
practical-business/src/main/java/com/platform/business/service/AuthenticatedUserService.java
View file @
04355d28
...
...
@@ -58,4 +58,21 @@ public class AuthenticatedUserService {
throw
new
BusinessException
(
"只有管理员可以发布平台消息"
);
}
}
/**
* 校验当前用户是否具备教师角色。
*
* <p>教案内容不绑定具体排课,因此不能通过 class_subject 反向证明教师身份;
* 必须使用项目现有 phone_role 角色映射进行入口权限校验。</p>
*/
public
void
requireTeacher
(
UserEntity
user
)
{
if
(
user
==
null
)
{
throw
new
BusinessException
(
"当前登录用户不存在"
);
}
List
<
SysPhoneRoleEntity
>
roles
=
phoneRoleService
.
queryByPhone
(
user
.
getPhoneNumber
());
boolean
teacher
=
roles
!=
null
&&
roles
.
stream
().
anyMatch
(
role
->
"教师"
.
equals
(
role
.
getRoleName
()));
if
(!
teacher
)
{
throw
new
BusinessException
(
"只有教师可以访问教案管理接口"
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment