Questions tagged [scopes]

An OAuth Scope is a permission setting that limits the permissiveness of a given OAuth Token. Clients therefore provide a list of desired Scopes when obtaining a Token (alongside standard OAuth ClientId and Client Authentication details). The Token will then be granted (or not) according to the Authentication process and the Scopes granted for the given Client Id

383 questions
0
votes
1 answer

Rails CanCanCan & Defining Abilities

I am trying to make an app in Rails 4. I am using CanCanCan for permissions and Role_Model for roles management. In my ability.rb, I have defined student abilities as: elsif user.try(:profile).present? && user.profile.has_role?(:student) …
Mel
  • 2,481
  • 26
  • 113
  • 273
0
votes
1 answer

Can't get global variable

Here is the window: so now, when I scroll down (the children appear in the same fashion as displayed above, all way long), I see what I want: but I just fail to access it. Why? Here the code, in a function that lies in a js folder: function…
gsamaras
  • 71,951
  • 46
  • 188
  • 305
0
votes
1 answer

RubyOnRails multiple scopes composition

I got a Product model with has_many Types table and several scopes: class Product < ActiveRecord::Base has_many :product_types has_many :types, through: :product_types scope :type1, -> { joins(:types).where(types: { name: "Type1" }) } …
0
votes
1 answer

Python Metaprogramming. Generating massive amount of similar tests where a variable value is changed

We have a massive amount of test cases classes to perform some checks. I need to generate all those same tests but change the value of a variable. For example: class DynamicPivotSeriesTestCase(AuthenticatedApiTestCase): ''' Test all series…
FranGoitia
  • 1,965
  • 3
  • 30
  • 49
0
votes
1 answer

eloquent javascript chapter regarding modules. On scopes and eval function

Eloquent javscript writes this in chapter 10 of the modules chapter: The most obvious way is the special operator eval, which will execute a string of code in the current scope. This is usually a bad idea because it breaks some of the sane…
Jwan622
  • 11,015
  • 21
  • 88
  • 181
0
votes
0 answers

JSF Scopes and Beans

I am having hard time understanding when and where to use scopes. I read through a lot on google, and I know what sessionscope, requestscope and all other scopes. But not clear enough in which type of class it should have sessionscope or request…
Bhavana k
  • 1
  • 1
  • 4
0
votes
2 answers

Scope for single controller, multiple views

I have been studying new java 1.8 + CDI + WildFly And JSF 2.2. I´ve read a lot about the scopes and still can´t figure out which scope should i use or what is the best practice to get a single controller to work with diferent views. Can´t use the…
JoseGarcia
  • 11
  • 1
0
votes
0 answers

Angularjs i cannot display my data in controller into directives

I have graphs made in Angular JS. I have two directives , the first one named Linear Chart 1 is for individual graphs and the second one named Linear Chart is compilation of each graph in the first one. My problem is that I cannot access controller…
0
votes
1 answer

Trying to refactor Rails 4.2 scope

I have updated this question I have the following SQL scope in a RAILS 4 app, it works, but has a couple of issues. 1) Its really RAW SQL and not the rails way 2) The string interpolation opens up risks with SQL injection here is what I have: scope…
user4713761
0
votes
2 answers

Rails scope with complex SQL Statement including OR

I'm working on a small Rails project right now. I'm using Pundit for authorization of controller actions and stuff. The job right now is to use Pundit for the index action and use Pundit's policy_scope in my controller to get the Projects a user can…
bastianwegge
  • 2,435
  • 1
  • 24
  • 30
0
votes
3 answers

Google API: request Additional Scopes

How can I add scopes to an existing access token? If I read this page correctly, it is possible to do that: https://developers.google.com/+/web/signin/incremental-auth But I am having troubles understanding how to implement that. In theory, I should…
Andy Wallace
  • 609
  • 8
  • 26
0
votes
1 answer

C++ 11- scopes & global variables

How can I reach global variables from inner scopes, given the following code sample, how can I reach the global string X from the main function and from the most inner scope as well, also is the most inner scope is accessible once we quit it to the…
A_Matar
  • 2,210
  • 3
  • 31
  • 53
0
votes
3 answers

Python scopes in For -Else

I am learning python and couldn't understand what is going on with flag in the below code snippet. Since I have updated the flag to false with in the if suite, I expect to see false printed from else, but the output shows true. Can someone please…
user2928913
  • 223
  • 1
  • 6
  • 15
0
votes
2 answers

How repeat modelos for a specific marca in this example?

I want to repeat just of chevrolet modelos for example. this is my code
  • {{tipo.nombre}}
var app =…
Gerard
  • 11
  • 1
  • 2
0
votes
1 answer

Scopes, timer and loop in a javascript object fired on scroll

Here is the example. I create an object that have 3 elements referenced by the first parameter (document.querySelectorAll...) the I loop through those elements and launch a specific scrolling function (simplified in the example. Inside this function…
Lionel T
  • 1,559
  • 1
  • 13
  • 30