NAME

Articulate::Authorisation::Preconfigured - allow access to users in your config

CONFIGURATION

Put this in your config:

components:
  authorisation:
    Articulate::Authorisation:
      rules:
        - class: Articulate::Authorisation::Preconfigured
          rules:
            zone/public:
              "[guest]":
                read: 1
              admin: 1

ATTRIBUTES

rules

The rules used to determine whether or not requests are authorised. Defaults to {}.

METHODS

new

No surprises here.

permitted

Goes through each of the locations in 'rules' (in ascending order of length) and if the location in the permission request begins with that rule, then look at the contents.

We then expect a hash of user ids, or [guest] for users not logged in. Their values should be 0 (for deny), 1 (for grant), or a hash of verbs to grant/deny.

This is preconfigured access, so fine for a small personal or static site, but if you have open sign-up or changing requirements then you will probably find changing the config file and reloading the app gets tedious after a while.