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
3
votes
1 answer

Rails multi-tenancy, scopes, class variables and thread safety

Short Version Are class variables thread-safe for the duration of a controller action? Long Version I'm writing a Rails 3 app that implements multi-tenancy using a single database schema with tenant_id columns in each table to identify to whom the…
3
votes
1 answer

AWS Cognito Resource server identifier and scopes Resource server brings

I've read docs and seen this. Struggling to put Cognito + API GW + OAuth2 pieces together. My questions: Do I correctly understand the flow and use of Resource server scopes: client app asks the Cognito user pool for a JWT token…
Max
  • 1,741
  • 3
  • 23
  • 40
3
votes
2 answers

Multiple scope in rails 3.0

I am a beginner in Rails and i have a problem with scope. I have my class with 2 scopes : class Event < ActiveRecord::Base belongs_to :continent belongs_to :event_type scope :continent, lambda { |continent| return if continent.blank? …
Sebastien
  • 6,640
  • 14
  • 57
  • 105
3
votes
4 answers

Can't change global variable inside function (JavaScript)

I have a global variable called result and a function, with the purpose of changing the value of result. here's the code I've tried: checkdate(); function checkdate() { //defining startdate,enddate,hotel_id $.ajax({ method: 'GET', …
HessamSH
  • 357
  • 1
  • 5
  • 18
3
votes
2 answers

problems with closure in JS

I have a problem with understanding closure when I have 3 level of scopes https://jsfiddle.net/Ar2zee/wLy8rkyL/1/ How I can get access to parameter "g" in level3 function, var a = 10; function level1(b) { var c = 1; function level2(f)…
Ar2zee
  • 410
  • 1
  • 4
  • 12
3
votes
0 answers

Multiple space-delimited Google Admin SDK scopes causing invalid_scope error

NOTE - Since I am new to StackOverflow and only permitted two links, I've had to modify my URL snippets below and use backslashes after the https: since the editor thinks I'm writing URLs. I have successfully accessed our G Suite Admin SDK directory…
EricN
  • 31
  • 1
3
votes
1 answer

Passing current_scopes from the has_scopes gem as a param

I've been struggling with this problem for several days. I'm a lawyer and I'm building a Q&A type site for legal advice (yups, I'm a relative newbie to rails :-)). I want users to be able to filter questions by category (i.e. company law, IP etc…
3
votes
2 answers

How to duplicate Magento CMS pages and content blocks for additional language scopes

I neeed to find out if it is possible to duplicate a content block or page in Magento much in the same way that you can with products? For example, I can create a product in (English) and then select an alternative language scope (Italian) and paste…
Bernie Davies
  • 419
  • 6
  • 15
3
votes
3 answers

What scopes exist in spring mvc?

I know in servlets many scopes(request, session....). How it correlates with Spring MVC? How can I use needful scope using Spring style? I don't want directly use HttpRequest and HttpResponse.
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
3
votes
1 answer

Java CDI ConversationScope by calling Timer?

we are running a JavaEE 6 Environment with EclipseLink and JBoss Weld. For the EntityManager, we currently are using the @ConversationScoped scope and it works very well for the JSF interactions. We now want to include a @Schedule method for some…
bmurauer
  • 989
  • 8
  • 24
3
votes
1 answer

CDI & JPA: Best scope for repository classes

I'm wondering what would be the most efficient (in terms of needed resources) scope for a repository class in CDI. Imagine the following scenario: @RequestScoped //OR @ApplicationScoped OR @SessionScoped OR @ConversationScoped? public class…
user1727072
  • 309
  • 4
  • 14
3
votes
1 answer

Rails model with conditional scope depending on database

I'm implementing a scope for a model based on this railscast. The condition in the scope uses the binary AND operator &, like this: scope :with_role, lambda { |role| {:conditions => "roles_mask & #{2**ROLES.index(role.to_s)} > 0"} } Since the…
3
votes
2 answers

Get the average rating for each object

Probably a simple question for most, but still getting to grips with Database queries. I have recipes that can be given a rating, I now want to collect those ratings and get the average rating. A recipe has many ratings (I think this is the correct…
Richlewis
  • 15,070
  • 37
  • 122
  • 283
3
votes
1 answer

Are scopes in rails class or instance methods?

This is a question from a rails noob trying to understand concerns and scopes. I always thought scopes were class methods in rails but then the other day I saw this code from DHH: module Visible extend ActiveSupport::Concern` module…
Amit Erandole
  • 11,995
  • 23
  • 65
  • 103
3
votes
1 answer

rails 3 scopes inherited from other models

is there any way to use one model scopes as part of another model scope? Example class DocumentVersion < ActiveRecord::Base belongs_to :document scope :are_latest, lambda{ where(latest: true)} end class Document < ActiveRecord::Base has_many…
equivalent8
  • 13,754
  • 8
  • 81
  • 109