Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Wie an die Applikationsrechte im Kontext einer Org über SecuritySubject für einen anderen Nutzer als den angemeldeten Nutzer kommen?

Hallo zusammen,

ich möchte in einer lokalen Supersonic-Applikation testen, ob ein bestimmter anderer Nutzer bestimmte Rechte im Kontext einer Organisation hat?
Man kann das natürlich per Datenbankabfrage selbst bauen, aber gibt es vielleicht so etwas schon in der conx api?

VG
Michael

  
  
Posted one year ago
Votes Newest

Answers


Hi, there will be examples for your use-case in the next update of our supersonic app. In the meantime you can have a look at the API documentation at https://public.api.campusonline.community/q/swagger-ui/?urls.primaryName=Auth-API%20(auth)#/Roles%20of%20identity. There should also be interfaces ready in java libraries, see pub-auth-api-*.

Example Code:

 @GET
  @Authenticated
  @Path("/read-access-for-app-for-someone-else")
  public PermissionResource getReadPermissionForAppForSomeoneElse(
          @NotNull @QueryParam("org_id") String orgId,
          @NotNull @QueryParam("person_uid") String personUid) {

    SecuritySubject otherSubject = securitySubjectService.createForPersonUid(personUid)
            .orElseThrow(() -> new BadRequestException("person not found"));

    SecurityContext context = SecurityContext.withOrgId(orgId);

    if (!otherSubject.hasRole(ContextRole.createRole(context, EXAMPLES_READ))) {
      return new PermissionResource(PERMISSION_FOR_APP_IN_CONTEXT, false);
    }

    return new PermissionResource(PERMISSION_FOR_APP_IN_CONTEXT, true);
  }

Cheers luke

  
  
Posted one year ago
Lucas Reeh
108 × 4 Administrator
3K Views
1 Answer
one year ago
one year ago
Tags