Users receive an error when duplicating an activity if they do not have that activity's addinstance permission.
To reproduce:
1. Create an activity or resource in a course - eg a Book
2. Remove mod/book:addinstance from the Teacher role
3. Log in as a teacher, and try to duplicate the book (using the Edit action menu). Error returned:
error/No permission to create that activity
Debug info: Error code: No permission to create that activity $a contents:
Stack trace: * line 115 of /course/rest.php: moodle_exception thrown