Comments (5)
This is the reason I changed the signature of getSubject in 2.3.3 to return a Subject and not a promise. You're using 2.3.2, I guess?
from deadbolt-2-java.
Yes, I will update. But I got the following error when rewriting the getSubject method.
[error] /home/johdah/Development/svn/MobitecAccess/branches/Johan/Hibernate/app/auth/MyDynamicResourceHandler.java:188: non-static method checkPatternEquality(be.objectify.deadbolt.core.models.Subject,java.lang.String) cannot be referenced from a static context
[error] DeadboltAnalyzer.checkPatternEquality
MyDynamicResourceHandler looks like this.
public boolean isAllowed(final String name, final String meta, final DeadboltHandler deadboltHandler, final Http.Context ctx) {
final DynamicResourceHandler handler = HANDLERS.get(name);
// return deadboltHandler.getSubject(ctx).map(
// new F.Function<Subject, Boolean>() {
// @Override
// public Boolean apply(Subject subject) throws Throwable {
if(meta.isEmpty()) return true;
Subject subject = deadboltHandler.getSubject(ctx);
// Check if permission pattern applied as meta is allowed!
if(!DeadboltAnalyzer.checkPatternEquality(subject, meta)) {
Logger.debug(String.format("Access failed to %s", meta));
return false;
}
boolean result = false;
if (handler == null) {
Logger.error("No handler available for " + name);
} else {
result = handler.isAllowed(name, meta, deadboltHandler, ctx);
}
return result;
// }
// }
// ).get(1, TimeUnit.SECONDS);
}
from deadbolt-2-java.
DeadboltAnalyzer's methods are not static any more, because people were asking for DI support. You can declare a static DeadboltAnalyzer in your MyDynamicResourceHandler class and reference that instead.
from deadbolt-2-java.
Thanks! Then it will hopefully work without the errors now then.
from deadbolt-2-java.
No further issues reported on this topic.
from deadbolt-2-java.
Related Issues (20)
- Infinite timeout when using convenience functions like restrict, restrictOr, etc. HOT 6
- Problem with Template constraints HOT 6
- [2.7] Use "route modifier tags" for commented routes HOT 5
- ERROR on use comment routes and subject present HOT 3
- ERROR at clean dist HOT 1
- RoleBasedPermissions are not consistent with Restrict HOT 3
- @Inherited is not respected HOT 7
- Tracking missing documentation
- [2.7] Avoid Http.Context.current()
- @Dynamic interferes with Config.load HOT 8
- Cross build for Scala 2.13 as soon as Play supports it HOT 1
- AND / OR modes for filters
- not found: value restrict HOT 6
- Examples needed for Play 2.8.x Template Constraints HOT 1
- How the get Subject *within* Controller method? HOT 1
- missing class DeadboltActions
- Upgradation of Deadbolt with security patches and Scala 3 support HOT 3
- Support Play Framework 2.9.0 HOT 2
- Add a CUSTOM type to ConstraintPoint, and allow it to be parameterized with a String.
- Take a look at Java 21 warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deadbolt-2-java.