rich7420 commented on PR #4010:
URL: https://github.com/apache/gravitino/pull/4010#issuecomment-2205181458
> > > @qqqttt123 According to the idea, Maybe I can change code like this to
add `ALLOW_INSTANCE` and `DENY_INSTANCE`. What do you think?
> > > ```
> > > public static class CreateCatalog extends
GenericPrivilege<CreateCatalog> {
> > > private static final CreateCatalog ALLOW_INSTANCE = new
CreateCatalog(Condition.ALLOW, Name.CREATE_CATALOG);
> > > private static final CreateCatalog DENY_INSTANCE = new
CreateCatalog(Condition.DENY, Name.CREATE_CATALOG);
> > >
> > > private CreateCatalog(Condition condition, Name name) {
> > > super(condition, name);
> > > }
> > >
> > > /** @return The instance with allow condition of the privilege. */
> > > public static CreateCatalog allow() {
> > > return ALLOW_INSTANCE;
> > > }
> > >
> > > /** @return The instance with deny condition of the privilege. */
> > > public static CreateCatalog deny() {
> > > return DENY_INSTANCE;
> > > }
> > > }
> > > ```
> >
> >
> > Ok for me.
>
> This comment seems not be addressed.
Thank you for your feedback. Added static constants ALLOW_INSTANCE and
DENY_INSTANCE in each privilege class, These constants are initialized when the
class is loaded, ensuring the instances are created only once. What else can I
improve on?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]