You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is what the signature for the getPermissions method in Subject.java looks like right now:
List<? extends Permission> getPermissions();
But in my case (and, I imagine, for other people as well) I need to fetch permissions for a given user from the database, which shouldn't block my app. This is how I've implemented this interface in my actual User class (note that I have to block the thread at the end because I need to return a List[java.List] of it doesn't match the interface signature.
defgetPermissions: java.util.List[Permission] = {
valq=for {
u <- users if u.id ===this.id
uxug <- users_x_user_groups if uxug.userId === u.id
ug <- user_groups if ug.id === uxug.userGroupId
pug <- permissions_x_user_groups if (pug.userGroupId === ug.id || pug.userGroupId === ug.parentGroupId)
p <- permissions if p.id === pug.permissionId
} yield (p)
valf= db.run(q.result)
Await.result(f, 10.seconds).toList.asJava
}
Is there some way to be able to return a Future without needing to fork the repo and changing the signature in Subject.java ? I'm not a very experienced Scala dev so it's possible I missed some simple solution.
The text was updated successfully, but these errors were encountered:
"Tomorrow" might have been a bit premature, because I'm releasing the Java 2.4.0 final version today, and this is a non-trivial change. I'll slate this for v2.4.1.
I've been thinking about this, and chatted to a few other users, and it seems to make more sense to retrieve roles and permissions at the point the subject is retrieved.
That's great! Actually when the action access the request it will fetch the role and permissions first, why not do it in one space? And I think we must keep the implement to fetch the subject only.
By the way, it's import to fetch the role and permission in other class but not the subject class. It's better to keep the subject, role, permission more pojo.
This is what the signature for the getPermissions method in Subject.java looks like right now:
List<? extends Permission> getPermissions();
But in my case (and, I imagine, for other people as well) I need to fetch permissions for a given user from the database, which shouldn't block my app. This is how I've implemented this interface in my actual User class (note that I have to block the thread at the end because I need to return a List[java.List] of it doesn't match the interface signature.
Is there some way to be able to return a Future without needing to fork the repo and changing the signature in Subject.java ? I'm not a very experienced Scala dev so it's possible I missed some simple solution.
The text was updated successfully, but these errors were encountered: