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
2
votes
0 answers

How to use Trees.isAccessible() for primitive datatypes in Java Compiler API / How to convert TypeMirror to DeclaredType

I am trying to analyze .java-files using the Java Compiler API. My current problem is to find out, whether a given variable, method or class is known at a specific scope in the program (with scope I mean a scope as it is defined in the Java Compiler…
bpaassen
  • 31
  • 3
2
votes
2 answers

ActiveRecord associations and scopes oh my

I'm trying to figure out how to pull data from multiple tables and making sense of it. I have events, occurrences and venues tables. Here are the models/associations so far: models/event.rb: class Event < ActiveRecord::Base has_many :occurences,…
2
votes
1 answer

How are Ruby Blocks implemented (in a compiler)

I want to implement a language construct similiar to Ruby´s blocks. So main() { i = 123 array.function(|x| { puts x + i; }) //the block needs access to the local variable i } should compile fine. I looked at the source code for 1 hour but…
Moritz Schöfl
  • 763
  • 2
  • 7
  • 19
1
vote
0 answers

next, previous based on current sort order

I have scopes defined in an include module like this: module ActsAsAdjacent def self.included(base) base.send(:scope, :next, lambda {|id| {:conditions => ["id > ?",id], :order => "id ASC", :limit => 1}}) base.send(:scope,…
Mark
  • 1,214
  • 10
  • 24
1
vote
1 answer

Fetch Rails join model records based on condition in joined table

I'm wondering if there's a "proper" Rails (3.1) way to do this without just using a finder SQL. I have an STI hierarchy: class Party class Person < Party class Organisation < Party Related parties are joined via a party_relationships table and…
1
vote
3 answers

Scopes and nested namespaces for C#

I have a project in C# where there are two namespaces defined in seperate files where one is the subset of the other: namespace RSSTimerJob namespace RSSTimerJob.Features.RSSFilter I have a static class called Toolbox which belongs to the 1st…
Gautham C.
  • 1,135
  • 11
  • 12
1
vote
0 answers

How to get Devise scopes to send the correct confirmation e-mail template?

I'm trying to use Devise with multiple scopes without overriding the Devise controllers until I absolutely have to. I think I may have reached a point to where I finally will have to override the controllers. I have three different…
Jason H
  • 501
  • 4
  • 11
1
vote
3 answers

What's the best way to handle logging in and out with multiples scopes/roles with Rails/Devise?

I've been searching through the Devise RDocs, Google, on this site for answers to my question, but no luck. Let's say I have four Devise scopes/roles, and each one has their own attributes, login page, and separate web…
Jason H
  • 501
  • 4
  • 11
1
vote
1 answer

Google Drive API service->files->get('root') fails with "file not found.' (Scopes problem?)

I have a PHP script that fails (404, [file] not found) when the following code is executed: $result = $service->changes->getStartPageToken() ; $nextStartPageToken = $result->startPageToken ; $rootResult = $service->files->get('root') The the…
Dennis
  • 1,071
  • 2
  • 17
  • 38
1
vote
1 answer

Can Different Users of a Google Apps Script Project Allow Different OAuth rights?

We have a membership spreadsheet that contains a Google Apps Script triggered hourly that manages our organization since 2016. It runs under its own account, reads a calendar, generates reservation forms and response spreadsheets, reads and writes…
higlider
  • 13
  • 4
1
vote
1 answer

Typescript class member initialisers are inlined into the constructor of the class

This behaviour seems fairly well documented (See Initializing variables inline during declaration vs in the constructor in Angular with TS here on SO for example), but it can cause some really hard to track down memory issues. See the following…
phb
  • 691
  • 4
  • 7
1
vote
0 answers

scopes and permissions in dotnet using abp framework, permission-based authorization using scopes

Scope Permissions: If we have two clients accessing the same API, the first client being an admin and the second client being mobile users only, how can we set permissions based on their scopes? The scope_admin should have permissions 1, 2, 3, and 4…
1
vote
0 answers

How to request different sets of scopes for different types of users?

I have a React application and I have a Spring Boot backend currently using Spring Security to authenticate the users using OAuth2 code grant flow, with both Google and Azure. This was all working fine when I had just one type of user that required…
cowley05
  • 123
  • 1
  • 1
  • 10
1
vote
3 answers

Discord.py Bot Link returns No Scopes even though I added scopes

After coding a bot in Discord.py, while generating an invite link, I've added all the scopes and I was able to go through and authorize the bot. Then, while inviting it to the server, it gives this page: enter image description here There are scopes…
1
vote
1 answer

How to write specs for rails associations?

They say the perfect test just includes the test framework and the class being tested; everything else should be mocked. Then, what about associations? And I don't mean simple has_many, belongs_to associations, but association extensions and scopes.…
Erik Escobedo
  • 2,793
  • 24
  • 42