Show
Ignore:
Timestamp:
04/06/08 09:02:15 (5 years ago)
Author:
drry
Message:

lang/ruby/path_observer/trunk/lib/path_observer/observe_manager.rb
lang/ruby/path_observer/trunk/lib/path_observer/observer.rb
lang/ruby/path_observer/trunk/README
lang/ruby/date_time-duration/lib/date_time/duration.rb
lang/ruby/osxhotkey/README
lang/lua/bluasxom/lib/List.lua
lang/perl/Catalyst-Controller-AllowDisable?/trunk/lib/Catalyst/Controller/AllowDisable.pm
lang/perl/Catalyst-Controller-AllowDisable?/trunk/Makefile.PL
lang/perl/Catalyst-Controller-AllowDisable?/trunk/README
lang/perl/Catalyst-Helper-Lighty/trunk/LISENCE
lang/perl/Catalyst-Helper-Lighty/trunk/LICENSE
lang/perl/Catalyst-Helper-Lighty/trunk/MANIFEST
lang/perl/Catalyst-Plugin-FormValidator?-Lazy/trunk/lib/Catalyst/Plugin/FormValidator/Lazy.pm
lang/perl/Catalyst-Plugin-Log-Colorful/trunk/lib/Catalyst/Plugin/Log/Colorful.pm
lang/perl/WebService-Simple/trunk/lib/WebService/Simple.pm
lang/perl/WebService-Simple/trunk/lib/WebService/Simple/Response.pm
lang/perl/misc/bot-kouen-debyu.pl
lang/perl/misc/google_code_search.pl
lang/perl/misc/hatena-keyword.pl
lang/perl/Sledge-Plugin-FormValidator?-Lazy/trunk/lib/Sledge/Plugin/FormValidator/Lazy.pm
lang/perl/Net-OAuth-Consumer/trunk/lib/Net/OAuth/Consumer.pm
lang/perl/Net-Twitter-FriendFinder?/trunk/lib/Net/Twitter/FriendFinder/From/TwitterKensaku.pm
lang/perl/Net-Twitter-FriendFinder?/trunk/lib/Net/Twitter/FriendFinder/From/TwitterDiff.pm
lang/perl/Net-Twitter-FriendFinder?/trunk/lib/Net/Twitter/FriendFinder/From/Google.pm
lang/perl/Net-Twitter-FriendFinder?/trunk/lib/Net/Twitter/FriendFinder/From/Twitter.pm
lang/perl/Net-Twitter-FriendFinder?/trunk/lib/Net/Twitter/FriendFinder/From/URL.pm
lang/perl/Net-Twitter-FriendFinder?/trunk/lib/Net/Twitter/FriendFinder.pm
lang/perl/Data-LazyACL/trunk/lib/Data/LazyACL.pm
lang/perl/Data-LazyACL/trunk/README
lang/perl/Iterator-Simple/trunk/lib/Iterator/Simple.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/Media/Information.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/Search/User.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/Search/Media.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/Base.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/User/Video.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/User/Profile.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/User/Audio.pm
lang/perl/WWW-Stickam-API/trunk/lib/WWW/Stickam/API/User/Image.pm
lang/perl/Bundle-Porn/trunk/lib/Bundle/Porn.pm
lang/perl/Bundle-Porn/trunk/Makefile.PL
lang/perl/App-Starter/trunk/lib/App/Starter.pm
lang/perl/App-Starter/trunk/bin/app-starter.pl
lang/perl/App-Starter/trunk/bin/app-starter-catalyst.pl
lang/perl/Chaostr/trunk/lib/Chaostr/ValidateEm/Plugin/String.pm
lang/perl/Chaostr/trunk/lib/Catalyst/Plugin/FormValidateEm.pm
lang/perl/Chaostr/trunk/extlib
lang/perl/Acme-PSON/trunk/lib/Acme/PSON.pm
lang/perl/Acme-DRYCopyPaste/trunk/lib/Acme/DRYCopyPaste.pm
lang/perl/OAuth-Lite/trunk/lib/OAuth/Lite/Util.pm
lang/perl/MozRepl/trunk/lib/MozRepl/Plugin/JSON.pm
lang/perl/FormValidator-LazyWay?/trunk/lib/FormValidator/LazyWay/Plugin.pm
lang/perl/FormValidator-LazyWay?/trunk/lib/FormValidator/LazyWay/Results.pm
lang/perl/FormValidator-LazyWay?/trunk/lib/FormValidator/LazyWay.pm:

  • SYNOPSIS
Location:
lang/perl/Data-LazyACL/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Data-LazyACL/trunk/README

    r2243 r8953  
    66or 
    77 
    8 perl -MCPAN -e 'install Data::LazyACL' 
     8perl -MCPAN -e'install Data::LazyACL' 
    99 
    10  
  • lang/perl/Data-LazyACL/trunk/lib/Data/LazyACL.pm

    r2243 r8953  
    2929 
    3030    my $digit = 1; 
    31     for  my $access_key ( @{ $access_keys }  ) { 
    32      
     31    for my $access_key ( @{ $access_keys }  ) { 
     32 
    3333        if( $access_key eq 'admin' ) { 
    3434            croak q{You can not use reserved word 'admin' as access key.}; 
    3535        } 
    36          
    37         $s->{access_key}{ $access_key } = $digit;    
     36 
     37        $s->{access_key}{ $access_key } = $digit; 
    3838        $digit++; 
    3939    } 
     
    4242 
    4343sub has_privilege { 
    44     my $s           = shift; 
    45     my $access_key  = shift; 
     44    my $s          = shift; 
     45    my $access_key = shift; 
    4646 
    4747    return 0 unless defined $s->{token}; 
     
    5353 
    5454    my $access_digit =  $s->{access_key}{ $access_key } ; 
    55      
     55 
    5656    croak 'can not find access key [' . $access_key . ']' unless $access_digit; 
    5757    my $acl = Math::BigInt->new( 2 ); 
     
    6969    my $s           = shift; 
    7070    my $access_keys = shift; 
    71      
     71 
    7272    my $acl = Math::BigInt->new(); 
    7373 
     
    7676 
    7777        my $digit   = $s->{access_key}{ $access_key } ; 
    78          
     78 
    7979        croak 'can not find access key [' . $access_key . ']' unless $digit; 
    8080 
     
    9999        my $digit = $s->{access_key}{ $key }; 
    100100 
    101         $mb->bpow( $digit - 1 );     
    102          
     101        $mb->bpow( $digit - 1 ); 
     102 
    103103        if( $mb->band( $token ) ) { 
    104104            push @access_keys , $key ; 
    105105        } 
    106  
    107106    } 
    108107 
     
    122121        my $digit = $s->{access_key}{ $key }; 
    123122 
    124         $mb->bpow( $digit - 1 );     
    125          
     123        $mb->bpow( $digit - 1 ); 
     124 
    126125        if( $mb->band( $token ) ) { 
    127126            $access_keys->{ $key } = 1; 
    128127        } 
    129  
    130128    } 
    131129    return $access_keys; 
     
    140138 
    141139I am tired of having multiple flags or columns or whatever to implement Access 
    142 Control List , so I create this module. 
    143  
    144 This module is simple and easy to use,  a user only need to have a token 
     140Control List, so I create this module. 
     141 
     142This module is simple and easy to use, a user only need to have a token 
    145143to check having access or not. 
    146144 
    147 =head1 SYNOPSYS 
     145=head1 SYNOPSIS 
    148146 
    149147 my $acl = Data::LazyACL->new(); 
     
    164162    print "Never Dispaly\n"; 
    165163 } 
    166   
    167  my $access_keys_ref  
     164 
     165 my $access_keys_ref 
    168166    = $acl->retrieve_access_keys_for( $token ); 
    169   
     167 
    170168 my $access_keys_hash_ref 
    171169    = $acl->retrieve_access_keys_in_hash_for( $token ); 
     
    180178 
    181179Set all access keys. You can never change this array of order once you 
    182 generate token , otherwise you will messup permissins. When you want to add new keys then just append.   
     180generate token, otherwise you will messup permissins. When you want to add new keys then just append. 
    183181 
    184182=head2 $token = generate_token( \@user_access_keys ) 
     
    188186=head2 \@access_keys = get_all_access_keys() 
    189187 
    190 Get access keys which you set with set_all_access_keys() .. means not include 
     188Get access keys which you set with set_all_access_keys()... means not include 
    191189'admin'. 
    192190 
     
    196194method check privilege based on this token. 
    197195 
    198 If you want to have all access then use reserve keyword 'admin' . 
     196If you want to have all access then use reserve keyword "admin". 
    199197 
    200198 my $admin_token = $acl->set_token( 'admin' ); 
     
    221219Tomohiro Teranishi <tomohiro.teranishi+cpan@gmail.com> 
    222220 
    223 =head1 COPYRIGHT 
     221=head1 LICENSE 
    224222 
    225223This program is free software. you can redistribute it and/or modify it under