pundit Questions
2
Solved
I use pundit for authorization and RSpec for testing in my rails app. Due to this, I had to create specs for the policies.
However, I am having a problem with rubocop throwing an error: RSpec/Multi...
Kania asked 17/4, 2021 at 19:14
4
Solved
I'm pretty new with Rails and I have a problem with the following policies (using Pundit): I'd like to compare two objects: @record and @foo, as you can see here:
class BarPolicy < ApplicationP...
Riplex asked 29/1, 2015 at 14:5
2
Solved
I've added the configuration pundit addapter authorization to my application
config.authorization_adapter = ActiveAdmin::PunditAdapter
When I login with the [email protected] credentials I...
Hayman asked 11/1, 2015 at 2:28
4
Solved
In one of my project I started to using pundit gem and I have a very simply policy that looks like this:
class CompanyPolicy < ApplicationPolicy
def index?
true if user.is_a? Administrator
e...
Cacilia asked 16/2, 2015 at 7:45
1
I'm using ActiveAdmin gem together with Pundit (and Rolify) gem.
This is how I wrote my policy (taken from: https://github.com/activeadmin/activeadmin/blob/master/spec/support/templates/policies/a...
Equivalency asked 10/6, 2020 at 12:20
3
Solved
I'm installing an app with Pundit authorization and when I try to run RSpec tests I get:
undefined method `permissions'
for RSpec::ExampleGroups::UserPolicy:Class
(NoMethodError)
Lindyline asked 10/9, 2014 at 11:53
2
I have just made the switch to Pundit from CanCan. I am unsure about a couple of things, and how Pundit is best used.
For example:
If you have a resource that can have multiple parent objects, fo...
Tuchun asked 31/1, 2014 at 0:47
4
In my project, i have pretty common namespace "admin".
namespace :admin do
resources :users, except: :show
end
I use Pundit gem to set proper authorization, but i found it difficult to use with...
Joannejoannes asked 21/1, 2014 at 10:9
2
I want to skip the policy_scope requirement fro Pundit on one controller (home). I have tried this:
class ApplicationController < ActionController::Base
include Pundit
after_action :verify_a...
Lohner asked 3/9, 2014 at 18:20
3
Solved
I'm using Pundit with Rails, and I have a controller that I need to completely restrict from a specific user role. My roles are "Staff" and "Consumer." The staff should have full access to the cont...
Grunter asked 6/2, 2019 at 2:16
2
Solved
I've got a pretty simple Pundit policy with a scope for different user roles. I can't figure out how to test it in Rspec. Specifically, I don't know how to tell the scope what user is logged in bef...
Bicker asked 23/1, 2019 at 15:27
2
The Tools
Pundit Authorisation; experimenting with this pull request linked to from the official Pundit README;
ActiveInteraction domain service objects ("DSOs");
RSpec 2.99.1
** The Project**
...
Waitabit asked 22/7, 2014 at 7:7
2
Solved
I have been recently reading through the pundit gem's README and noticed that they never authorize the index view within a controller. (Instead they use scope).
They give good reasoning for this,...
Bonefish asked 25/8, 2016 at 14:34
1
Solved
I have a Rails app with Clearance and Pundit and I'm trying to create "teams" where the "Team Leader" can invite other users to join their team. I would like to do something similar to devise_invit...
Jenette asked 23/5, 2018 at 14:56
1
I like the simplicity of Pundit gem and I would like to make policies dynamic by storing them to database.
Basically I'm looking for a way to be able to change policies without need to redeploy th...
Adelladella asked 2/12, 2016 at 22:6
2
Solved
I am using rails 4, devise for authentication and Pundit for authorization. I have restricted my application to check for authorization on every controller by below code.
class ApplicationControl...
Vtol asked 23/5, 2015 at 1:37
1
Solved
I'd like to thoroughly test a Rails application authorization setup (Pundit) with RSpec.
The Pundit docs and other respectful sources suggest writing unit tests for Pundit policy classes. Are tho...
Tye asked 1/6, 2017 at 19:25
2
I have a multiple select box for a has_many association. The params come in as:
foo_ids: ["1", "2", "3"]
Using strong parameters, I do not permit this attribute because I would like to authorize...
Goraud asked 20/8, 2013 at 15:14
1
I'm using the gems pundit and devise. I have a delete link that only shows up if you are an admin. I have an integration test that I would like to verify that the delete link only shows up for admi...
Oza asked 15/3, 2016 at 1:39
1
Solved
I'm on rails 5 and I'm trying to implement authorizations with pundit for my rails_admin panel. So I included pundit in my application controller and installed the rails_admin_pundit gem as you ca...
Woolfell asked 2/11, 2016 at 10:14
6
I'm using pundit for access control in the admin section of my app. I have a dashboards controller that looks like this:
class Admin::DashboardsController < AdminController
def index
@total_r...
Imperator asked 5/8, 2014 at 14:32
1
Solved
What might be causing this error in verify_authorized method and how to fix it?
Poppas asked 28/1, 2016 at 20:31
3
I am trying to make an app with Rails 4.
I have defined a series of roles with Rolify gem.
Now, I want to use pundit to allow users with a role to do certain things. Where more than one type of r...
Trin asked 21/2, 2016 at 3:33
3
Solved
I am trying to make an app in Rails 4.
I am trying to use statesman gem for states and then pundit for policies.
My gemfile has:
gem 'statesman', '~> 1.3', '>= 1.3.1'
gem 'pundit'
I hav...
Cherey asked 29/1, 2016 at 0:24
3
Solved
By Default: the paperclip gem stores all attachments within the public directory.
I did not want to store the attachments within the public directory for security reasons, so I saved them within a...
Rede asked 11/1, 2016 at 1:29
1 Next >
© 2022 - 2024 — McMap. All rights reserved.