forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support setting the RolesAllowed in the Panache REST Data extension
With these changes, we can specify the roles using the annotations `@ResourceProperties` at resource level, and `@MethodProperties` for method level. Fix quarkusio#28507 (cherry picked from commit dda7d78)
- Loading branch information
Showing
23 changed files
with
147 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...io/quarkus/hibernate/orm/rest/data/panache/deployment/repository/CollectionsResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package io.quarkus.hibernate.orm.rest.data.panache.deployment.repository; | ||
|
||
import io.quarkus.hibernate.orm.rest.data.panache.PanacheRepositoryResource; | ||
import io.quarkus.rest.data.panache.MethodProperties; | ||
import io.quarkus.rest.data.panache.ResourceProperties; | ||
|
||
@ResourceProperties(hal = true, paged = false, halCollectionName = "item-collections") | ||
@ResourceProperties(hal = true, paged = false, halCollectionName = "item-collections", rolesAllowed = "user") | ||
public interface CollectionsResource extends PanacheRepositoryResource<CollectionsRepository, Collection, String> { | ||
@MethodProperties(rolesAllowed = "admin") | ||
boolean delete(String name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...arkus/hibernate/reactive/rest/data/panache/deployment/repository/CollectionsResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package io.quarkus.hibernate.reactive.rest.data.panache.deployment.repository; | ||
|
||
import io.quarkus.hibernate.reactive.rest.data.panache.PanacheRepositoryResource; | ||
import io.quarkus.rest.data.panache.MethodProperties; | ||
import io.quarkus.rest.data.panache.ResourceProperties; | ||
|
||
@ResourceProperties(hal = true, paged = false, halCollectionName = "item-collections") | ||
@ResourceProperties(hal = true, paged = false, halCollectionName = "item-collections", rolesAllowed = "user") | ||
public interface CollectionsResource extends PanacheRepositoryResource<CollectionsRepository, Collection, String> { | ||
@MethodProperties(rolesAllowed = "admin") | ||
boolean delete(String name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.