Permalink
Commits on Jan 25, 2015
  1. version bump

    committed Jan 25, 2015
  2. cleanup

    committed Jan 25, 2015
Commits on Jan 20, 2015
  1. Add support for global per resource rules

    These rules apply to all the entities.
    They follow the same convention as the rules for all the resources('' is
    "all") and have lower priority than the specific rules.
    avereha committed Jan 20, 2015
Commits on Dec 21, 2014
  1. update README

    committed Dec 21, 2014
  2. new version

    committed Dec 21, 2014
  3. some refactoring

    committed Dec 21, 2014
Commits on Dec 19, 2014
  1. reflect change

    committed Dec 19, 2014
Commits on Oct 20, 2014
  1. update README for 0.006

    committed Oct 20, 2014
Commits on Oct 17, 2014
  1. reflect change

    committed Oct 17, 2014
  2. adding entity_groups

    committed Oct 17, 2014
  3. be just a tad stricter

    committed Oct 17, 2014
Commits on Jul 12, 2014
  1. a bit clearer

    mickeyn committed Jul 12, 2014
Commits on Jul 9, 2014
  1. new version: 0.005

    committed Jul 9, 2014
Commits on Jul 8, 2014
  1. new release: 0.004

    committed Jul 8, 2014
  2. improve vim ignore

    committed Jul 8, 2014
  3. Implement checking for non-existence of keys:

    You can now check that a key does *not* exist in the parameters,
    and not just whether it exists.
    
        my $rules = {
            Person => [
                Office => [
                    [ 1, { burglary_kit => undef } ]
                ]
            ]
        };
    
    This checks the Person does *not* have a burglary kit when trying
    to access the Office.
    committed Jul 8, 2014
Commits on Jul 7, 2014
  1. Check for only known references:

    If you now try to match a key's value in a parameter against an
    unknown reference (currently only code and regexp reference are
    recognized), it will crash, because it won't be able to match it
    correctly.
    
    In order to match it correctly, it will need to traverse all the
    tree and compare the values instead of the reference, because the
    reference will definitely not be the same (param reference vs.
    rules reference).
    
    So, instead of going all fucking apeshit, we're just not allowing
    it. You'll thank us later! :)
    committed Jul 7, 2014
  2. Implement regex matching on keys:

    You can now match key values against regular expressions:
    
        my $rules = {
            DeployUser => {
                Software => [
                    [ 1, { author => qr/^(Sawyer|Mickey)$/ } ]
                ]
            },
        };
    
    This will allow the DeployUser entity to deploy the Software,
    if the 'author' is either Sawyer or Mickey.
    committed Jul 7, 2014
  3. ignore swap files, damn it

    committed Jul 7, 2014
  4. Implement callback as a key value:

    You can now try to match a key against a code reference. You will
    receive the parameters and the value will be matched against the
    value of the key in the requested parameters:
    
        my $rules = {
            Developer => {
                Deploy => [
                    [ 1, # allow
                        'required',
                        { group => 'deployers'                     },
                        { now   => sub { time - $_[0]->{'delay'} } },
                        { responsible_person => 1 },
                        'credentials',
                    ,
                ]
            }
        };
    
    This will allow the Developer to Deploy if it has the keys 'required'
    and 'credentials', and if she is in the 'deployers' group, and if she
    has a boolean for 'responsible_person', and if the parameter 'now'
    matches the return value of the callback.
    committed Jul 7, 2014
  5. Implement callback as a rule:

    You can now use a callback as a rule in and of itself.
    
        my $rules = {
            Homer => {
                Office => [
                    [ 1, sub {
                        my $params = shift;
    
                        # is it work hours?
                        now - $params->{'work_hours'} >= 0
                            and return 1;
    
                        # no? fail
                        return;
                    } ]
                ]
            },
        };
    
    It can also be mixed with additional rules in the same ruleset, and,
    of course, labels.
    
        my $rules = {
            Homer => {
                Office => [
                    'can home go in the office?' =>
                    [ 1,
                        # rules
                        { time_of_day => 'Monday' },
                        sub {
                            my $params = shift;
    
                            # is it work hours?
                            now - $params->{'work_hours'} >= 0
                                and return 1;
    
                            # no? fail
                            return;
                        },
                        'key_to_the_office',
                    ]
                ]
            },
        };
    committed Jul 7, 2014
  6. Implemented callback as the action:

    Now you can provide a callback as the action, which will receive
    the entire result before it's sent to the user (lacking the 'action',
    of course, because it wasn't determined yet), and you could then
    return whatever result you want.
    
        my $rules = {
            CEO => {
                SecretData => [
                    [ 1, { superpower => 1 } ],
                    [
                        sub {
                            my $result = shift;
                            check_something()
                                and return 1;
                        },
                        'possibly_superpower',
                    ]
                ],
            },
        };
    committed Jul 7, 2014
  7. updated the doc a little

    mickeyn committed Jul 7, 2014
Commits on Jul 6, 2014
  1. readme updated

    committed Jul 6, 2014
  2. reflect changes

    committed Jul 6, 2014
  3. updates

    committed Jul 6, 2014
Commits on Jul 5, 2014
Commits on Jul 4, 2014
Commits on Sep 9, 2013
  1. new version: 0.002

    committed Sep 9, 2013
  2. small POD fix

    committed Sep 9, 2013
Commits on Sep 8, 2013
  1. add to readme

    committed Sep 8, 2013