Giter Club home page Giter Club logo

restful_acl's People

Contributors

glenngillen avatar mdarby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

restful_acl's Issues

errors on Rails 3.0.3 with postgres

I'm getting the error

undefined method `visit_ActiveSupport_SafeBuffer' for #Arel::Visitors::PostgreSQL:0x29a1b98

whenever the allowed? helper method is called. Not sure if it's just me though, but it worked fine on 3.0.0.

allowed? helper throwing error

uninitialized constant UrlParser::OpenStruct
Extracted source (around line #122):
119: }
120: </script>
121:
122: <%= allowed?{ link_to 'Sites', sites_path} %>
RAILS_ROOT: /Users/darnellbrawner/workspace/jetty_proj

/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in const_missing' /Library/Ruby/Gems/1.8/gems/restful_acl-3.0.3/lib/restful_acl/url_parser.rb:72:ininvoke_url_type_method'
/Library/Ruby/Gems/1.8/gems/restful_acl-3.0.3/lib/restful_acl/url_parser.rb:64:in options_hash' /Library/Ruby/Gems/1.8/gems/restful_acl-3.0.3/lib/restful_acl/helper.rb:5:inallowed?'
/Users/darnellbrawner/workspace/jetty_proj/app/views/sites/show.html.erb:122:in _run_erb_app47views47sites47show46html46erb' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:insend'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in render' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:306:inwith_template'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:in render' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/template.rb:205:inrender_template'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in render' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:348:in_render_with_layout'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:262:in render' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1250:inrender_for_file'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:945:in render_without_benchmark' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:inrender'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in ms' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:inms'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:in render' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1326:indefault_render'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1332:in perform_action_without_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:incall_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:638:in run_before_filters' /Users/darnellbrawner/workspace/jetty_proj/app/controllers/application_controller.rb:115:inwidwio'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in send' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:inevaluate_method'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:186:in call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:635:inrun_before_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:615:in call_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:inperform_action_without_benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in perform_action_without_rescue' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:inms'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in ms' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in perform_action_without_flash' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:inperform_action'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in send' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:inprocess_without_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in process' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:inprocess'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:incall'

script/server won't start

Hello,

I installed the gem, added config.gem 'restful_acl' in my environment.rb, added the denied route but when I try to start my local server using script/server it fails throwing this :

/Library/Ruby/Gems/1.8/gems/restful_acl-3.0.3/lib/restful_acl/helper.rb:12: syntax error, unexpected ',', expecting '|'
define_method("#{m}able?") do |*args, &block|

Am I missing something ?

Thanks

Marc

allowed? helper throwing error

When I try to use the allowed? helper in my show.html.erb file, I get this error:

uninitialized constant Edit

The url being protected is a nested resource edit url = /seasons/1/edit

I am using the 3.0.0 gem, and Rails 2.3.4

Testing

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

How to add extended view methods?

Hey Matt,

Firstly, great gem. We have a complex Linux-like permission setup for our users so a typical role-based solution just wouldn't work. I really have two questions and didn't know where else to ask them:

1.) Is there a way I can either write extensions for the view helper you've included (= ?allowed{url}) so I can determine if a link is allowed then do alternate content? For example, if a link isn't allowed for that user, I'd like to show something else, say a span or div instead. Since it's just a view helper, I don't get a return value that I can use in a Ruby conditional. Is there a way to do this as-is, and if not where can I go to extend it? I can't locate the helper.

2.) I like the idea of having RESTful methods that can each return their own boolean to determine authorization, but for our app those methods are unlikely to change from resource to resource. To keep it DRY, I tried sticking those model methods in a module and including it, but having those 2 class methods seems to really be hosing up the works. Do you know another way I can have resources all reference the same 5 methods without using a module?

Thanks again for such a great job.

Trying to put is_*able_by() into a module

I am currently trying to put your is_indexable_by() (and so on) rules into a module, but I'm stuck at the problem, that I cannot access the calling object, because it isn't passed as an argument and self within a module always refers to the module itself, but not the object which it is implemented in.

Do you know how to get this done? Maybe a small demo snippet module would do the trick here...

This would make your plugin even more modular, as you can define ACLs globally without hardcoding it in each model :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.