@@ -808,6 +808,38 @@ func TestTemplateACL(t *testing.T) {
808
808
require .Equal (t , http .StatusNotFound , cerr .StatusCode ())
809
809
})
810
810
811
+ t .Run ("DisableEveryoneGroupAccess" , func (t * testing.T ) {
812
+ t .Parallel ()
813
+
814
+ client , user := coderdenttest .New (t , & coderdenttest.Options {LicenseOptions : & coderdenttest.LicenseOptions {
815
+ Features : license.Features {
816
+ codersdk .FeatureTemplateRBAC : 1 ,
817
+ },
818
+ }})
819
+ version := coderdtest .CreateTemplateVersion (t , client , user .OrganizationID , nil )
820
+ template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID )
821
+
822
+ ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
823
+ defer cancel ()
824
+
825
+ acl , err := client .TemplateACL (ctx , template .ID )
826
+ require .NoError (t , err )
827
+ require .Equal (t , 1 , len (acl .Groups ))
828
+ _ , err = client .UpdateTemplateMeta (ctx , template .ID , codersdk.UpdateTemplateMeta {
829
+ Name : template .Name ,
830
+ DisplayName : template .DisplayName ,
831
+ Description : template .Description ,
832
+ Icon : template .Icon ,
833
+ AllowUserCancelWorkspaceJobs : template .AllowUserCancelWorkspaceJobs ,
834
+ DisableEveryoneGroupAccess : true ,
835
+ })
836
+ require .NoError (t , err )
837
+
838
+ acl , err = client .TemplateACL (ctx , template .ID )
839
+ require .NoError (t , err )
840
+ require .Equal (t , 0 , len (acl .Groups ), acl .Groups )
841
+ })
842
+
811
843
// Test that we do not return deleted users.
812
844
t .Run ("FilterDeletedUsers" , func (t * testing.T ) {
813
845
t .Parallel ()
0 commit comments