Harden LMS and exam-prep gates so only STUDENT is enforced, and return FREE effective_access_tier for OPEN_LEARNER so clients do not show paywall locks. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
737 B
Go
27 lines
737 B
Go
package domain
|
|
|
|
import "testing"
|
|
|
|
func TestRoleOpenLearnerBypassesSubscriptionAndSequentialLocks(t *testing.T) {
|
|
role := RoleOpenLearner
|
|
if !role.BypassesSubscription() {
|
|
t.Fatal("OPEN_LEARNER must bypass subscription gates")
|
|
}
|
|
if role.UsesLMSSequentialGating() {
|
|
t.Fatal("OPEN_LEARNER must not use sequential / precedence locking")
|
|
}
|
|
if !role.IsCustomerLearnerRole() {
|
|
t.Fatal("OPEN_LEARNER should be a customer learner role")
|
|
}
|
|
}
|
|
|
|
func TestRoleStudentKeepsSubscriptionAndSequentialLocks(t *testing.T) {
|
|
role := RoleStudent
|
|
if role.BypassesSubscription() {
|
|
t.Fatal("STUDENT must not bypass subscription gates")
|
|
}
|
|
if !role.UsesLMSSequentialGating() {
|
|
t.Fatal("STUDENT must use sequential / precedence locking")
|
|
}
|
|
}
|