cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Member

How to hide course enroll button unless user is authenticated?

By default all courses in Catalog are visible to public web traffic. Anyone can view and enroll for your courses. Now, let's say you want to restrict access, only to authenticated users. The general public could still browse courses, but only a registered user could enroll and/or pay for a course. There is currently no way to accomplish this in the configuration settings.

Tags (1)
7 Replies
Highlighted
Community Advocate
Community Advocate

You can turn off the enroll button. You can ask your CSM for more information about this. It is by javascript coding.

0 Kudos
Highlighted
Community Member

Figured it out...or at least I have a working hack in JQuery:

    //Hide enroll button for unauthenticated users
    //unsupported client-side .js hack
    //stripped down version for general use
 $( document ).ready(function() {
            if ($('#user-nav > a:contains("Login")').length > 0) {
                $('head').append('<style type="text/css">.product-footer {visibility:hidden;}.btn-action{visibility:hidden;}</style>');
$('.hero-action').append( '<a class="btn btn-info btn-lg" href="YOUR CANVAS URL GOES HERE">Login to Check Availability</a>');
            }
 });

//End code

This goes in the configuration section of the catalog, in the scripts container.

Highlighted
Community Advocate
Community Advocate

Great!

Highlighted
Community Advocate
Community Advocate

Which authentication are you using? We are moving to CAS and would love to hear your process. Does your Catalog sit on top of your Canvas Instance?

0 Kudos
Highlighted

We have a custom SSO solution that uses SAML. It seems to work well with Canvas and Catalog. I am not sure of the right way to describe the Canvas to Catalog architecture. They are closely linked, but at the same time they are separate systems with setup and configuration handled independently.

0 Kudos
Highlighted
Community Advocate
Community Advocate

It should be CAS if it is SSO. How do students login? Can you please post your Catalog URL?

0 Kudos
Highlighted

Authentication happens from Canvas for Catalog then through the SSO (SAML) here is the catalog: Hillel International 

SAML - Configuring Shibboleth and Canvas Authentication saml‌