Thanks, but my question was about how to assign roles, the
requireRole method does not do this. I think I’ve figured it out though.
The answer is to call the
role() method, in the same way as you’d call the
access() method, except that it doesn’t seem to take an array as the first argument. I’ve looked in the docs here and here and can’t find any mention of it. Why isn’t
role() documented? Is it not supposed to be used? Feels like its quite important.
Also, regarding the “docs” - there’s conflicting descriptions of how to use
requireRole. In some places it says
requireRole(["admin", "old-timer"]); and others it’s
requireRole("role:editor");. From my experiments it seems that you can supply an array or a singleton, but you should not prefix the role name with "
I know I’ve asked many times for documentation to be updated, and it never is. So I won’t ask any more. How about putting into github though so we can submit PRs?