Open a page and assert that the account in the browser may, or may not, open it. Allowed: the browser stays on the page and it shows no error box. Not allowed: the site shows its error box (for example "Access denied"), sends the browser to another page, or sends a visitor to the login form.
Examples
Then I should have access to "/course/management.php"
Then I should not have access to "/admin/search.php"
And we should have access to "/user/index.php?id=2"
Then I should not have access to "/course/management.php"
But we should not have access to "/admin/search.php"
Pattern
Then(/^(I |we )*should( not)* have access to "([^"]*)"$/, …)
Part of @webship-js/moodle-steps (github.com/webship/moodle-steps), a step pack for Webship-js 2.0.x.