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
Questions tagged [scopes]
383 questions
0
votes
1 answer
Rails scope issue
I am trying to add a scope to model. I am looking to calculate total plays from the db.
I am on Rails 3.2.13
MYSQL query provides the expected results.
SELECT COUNT(DISTINCT(CONCAT(stats.filename,stats.viewer_id)))
FROM `stats`
WHERE…

kilomo
- 249
- 2
- 6
- 17
0
votes
1 answer
ActiveRecord::Relation hits the Array method instead of my class method
In a Rails 3.2 model, was hoping to create a "to_csv" class method to generate CSV output from an ActiveRecord scope, like this:
class Post
# ...
def self.to_csv(options = {})
CSV.generate(options) do |csv|
scoped.each {|post| csv…

Tom Wilson
- 797
- 9
- 26
0
votes
0 answers
Why does @Inject fail when adding CDI Extension?
I'm trying to write a CDI extension. As soon as I add the META-INF/services/java.enterprise.inject.spi.Extension file, all injections are failing with the message WELD-001408 Unsatisfied dependencies for type... . The strange thing is, the…

user1727072
- 309
- 4
- 14
0
votes
0 answers
declaring scopes from an array in rails3
I have an array of symbols, and I'd like to declare a scope in an ActiveRecord model for each one.
The following does not work:
@@animal_types = [:horse, :cat, :dog]
@@animal_types.each do |a|
scope a, :conditions => "animal_type =…

William Budington
- 410
- 5
- 5
0
votes
1 answer
Injecting a scope through an association extension in Rails 2.3.17
I'm upgrading from Rails 2.3.5 to 2.3.17 and have come across a pretty obscure problem. I use the following extensions to inject a scope within an association accessor, and provider a custom builder:
module XYZFilterExtension
def…

Brendon Muir
- 4,540
- 2
- 33
- 55
0
votes
2 answers
Rails - add scope for certain controllers in a module based up a database setting
I have an api. In that api is a basecontroller that all other controllers inherit from. The basecontroller handles authentication and whether or not the API is on at all, etc.
There are users, and users can belong to a group. Users table has a…

Squadrons
- 2,467
- 5
- 25
- 36
0
votes
1 answer
@SessionScoped bean with @ViewScoped behaviour
I'm experiencing strange behaviour with my session scoped bean. I used following imports and annotations to make it sessionscoped:
EDIT : more Code
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
@Named
…

nico1510
- 606
- 9
- 29
0
votes
2 answers
scopes in javascript
I have a simpe object in javascript which has few methods..Two of them I want to periodicaly call with window.setTimeout functions. My current code looks like this.
var shakeResolver = function () {
var resolveTimeout;
console.log(this);
var…

simekadam
- 7,334
- 11
- 56
- 79
0
votes
1 answer
yii detecting if scope is in use
I was wondering if there's a method to detect if a scope is being used on an AR search in yii?
For example, a model might contain 2 scopes:
class MyModel extends CActiveRecord
{
...
function myScope1()
{
…

Stu
- 4,160
- 24
- 43
0
votes
2 answers
Writing scopes for many-to-many relationships
I've got an application with 3 models: Renters, Departments, Criteria.
# app/models/department.rb
class Department < ActiveRecord::Base
attr_accessible :name, :abbr
has_many :renter_departments
has_many :renters, :through =>…

Vidur
- 1,442
- 2
- 17
- 37
-1
votes
1 answer
Are there any OAuth2 id-token format standards?
I'm looking into building my own identity provider to handle attributes and would like each attribute to contain additional information such as if the attribute is verified or not.
I've noticed that Keycloak have solved it by adding another…

user3677636
- 331
- 3
- 14
-1
votes
1 answer
Are python literals saved inside function bodies?
I have a function which needs to execute inside a fairly tight loop so it's performance sensitive. Its a filtering function intended to save more expensive work. Most of the function is just a check against a static list.
So (stripping out some…

theodox
- 12,028
- 3
- 23
- 36
-1
votes
1 answer
Golang File reader scopes mistake
I'm trying to understand difference between two file-reading cases.
Code below works fine. We reading file line-by-line to the variable:
reader := bufio.NewReader(file)
var line string
for err != io.EOF {
line, err = reader.ReadString('\n')
…

Anatol'
- 9
- 4
-1
votes
2 answers
Laravel/Passport scope issue
Hi stackoverflow developers.
I'm facing an issue with Laravel/Passport scopes. An error occurs when i use a route with scope middleware.
{
"message": "in_array() expects parameter 2 to be array, null given",
"exception": "ErrorException",
"file":…

Amir Eleuch
- 69
- 7
-1
votes
1 answer
JavaScript - error this.first() is not a function
I'm just playing around and trying to figure out how the this object works and how do I pass scopes context with the bind function.
So far I got to this point (check code below), and found out that I can use bind with an object function in order to…

user3676224
- 863
- 2
- 11
- 25