robert-carroll / ccsd-canvas

CanvasLMS - Theme adjustments and feature augmentation
MIT License
29 stars 15 forks source link

Setup questions #2

Closed elearningdave closed 5 years ago

elearningdave commented 5 years ago

I know in your readme you say you don't feel the need to explain this step, but I can't find an example .cfg file in your github to use as a template.

Also, on line 1 of admintray-subaccmenu.inc.js it makes the following call: if (ccsd.util.hasAnyRole('admin','root_admin')) { Even if we comment this if statement (and the closing curly bracket) out, as we don't have the ccds.util declared anyway that we can tell.

We have put all the files (apart from the .inc.js one) into a folder on a web server, and pointed url: at the URL, and still it gives errors.

robert-carroll commented 5 years ago

Hi Dave, apologies for missing this for so long.

There is no cfg to setup within the script itself. There is a cfg object in the script, but the only setting is recursive, and you'll likely want that. https://github.com/robert-carroll/ccsd-canvas/blob/master/admintray-subaccmenu/admintray-subaccmenu.js#L9

The utility methods we use are available, https://github.com/robert-carroll/ccsd-canvas/tree/master/util

You're probably better off with this... https://community.canvaslms.com/people/james@richland.edu/blog/2017/06/14/hiding-content-from-certain-roles#comment-131777

if (['admin','root_admin'].some(a => ENV.current_user_roles.includes(a))) {
    // ...
}

I'd need to know more about the errors or the server you're hosting the files on to troubleshoot. Double check that you're using HTTPS and have CORS enabled.