My slurm is 23.02.6,I have used EnforcePartLimits=ALL,Users outside of AllowAccounts can still submit。
root@node196:/etc/slurm# scontrol show config |grep EnforcePartLimits
EnforcePartLimits = ALL
root@node196:/etc/slurm# scontrol show part
PartitionName=T1
AllowGroups=ALL AllowAccounts=root AllowQos=ALL
AllocNodes=ALL Default=YES QoS=N/A
DefaultTime=NONE DisableRootJobs=NO ExclusiveUser=NO GraceTime=0 Hidden=NO
MaxNodes=UNLIMITED MaxTime=UNLIMITED MinNodes=0 LLN=NO MaxCPUsPerNode=UNLIMITED MaxCPUsPerSocket=UNLIMITED
Nodes=node196
PriorityJobFactor=1 PriorityTier=1 RootOnly=NO ReqResv=NO OverSubscribe=NO
OverTimeLimit=NONE PreemptMode=OFF
State=UP TotalCPUs=4 TotalNodes=1 SelectTypeParameters=NONE
JobDefaults=(null)
DefMemPerCPU=1024 MaxMemPerNode=UNLIMITED
TRES=cpu=4,mem=4G,node=1,billing=4