| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Made the optional string permission in the CommandPermission public
There was a problem hiding this comment.
Definitely works as expected.
Would it be useful to make these other methods in CommandPermission public?
I'm not sure if it is necessary to mention this method in the docs: https://commandapi.jorel.dev/9.3.0/permissions.html. Maybe at least add javadocs to the method now that it's public.
You could also add this change to the Changelog in the README:
Sorry, something went wrong.
|
Probably don't, because the permissionNode can be null, and nullables should not be exposed according to the contribution guide and Skepter on Discord. |
Sorry, something went wrong.
Makes sense. I suppose you could also change the method signature of getPermissionNode to be an Optional. It might be helpful in the case when you want to check if the permission is OP or NONE. Although, CommandPermission objects with a non-null permissionNode should only be these constant fields since the constructor is private. So, a developer could just check if their CommandPermission object is equal to one of these. The isNegated method is probably important though for telling the difference between has permissionA and does not have permissionA
Yeah, you wouldn't change the old docs since the method wouldn't be public in 9.3.0. You'd change the source file here: https://github.com/JorelAli/CommandAPI/blob/46d1fa14990f9d3b6b9611e08f4e953f886291c9/docssrc/src/permissions.md. Then once the 9.4.0 docs are generated from the source files the change will be visible. But also yeah, I'm not sure if it's a big enough deal to mention?
I meant a Javadoc on the getPermission method. Public members should probably all have Javadocs, though I'm sure there's some places where they don't :P. |
Sorry, something went wrong.
I wouldn't change the signature of getPermissionNode because, as you mentioned, they could just check with the static instances. And for those who, for any reason, use reflection to access it, it remains accessible.
Yea, makes sense.
It doesn't really fit in the docs, so I would just not mention it there.
Makes sense. I thought you meant we should mention the change somewhere in the Javadocs. |
Sorry, something went wrong.
Added javadoc
| /** | ||
| * Returns if the permission is negated | ||
| * | ||
| * @return the permissions negation state |
There was a problem hiding this comment.
"permissions" is missing an apostrophe.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Made the optional string permission and negation state in the CommandPermission public