Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateRoleParams displayName is optional, but throws java.lang.NullPointerException #10486

Closed
ComLock opened this issue Mar 27, 2024 · 1 comment · Fixed by #10496
Closed
Assignees
Labels

Comments

@ComLock
Copy link
Member

ComLock commented Mar 27, 2024

createRole({
	name: 'roleName'
});

causes

2024-03-27 09:55:49,465 ERROR c.e.xp.portal.impl.main.MainExecutor - Error while executing com.acme.example.tsup Application controller
java.util.concurrent.CompletionException: java.lang.NullPointerException: displayName is required for a role

The documentation is unclear
https://developer.enonic.com/docs/xp/stable/api/lib-auth#createrole

Sidenote:
I appUsers it's not possible to create a role without displayName.
The name is just sanitized displayName.

We have two possible solutions:

  1. Make displayName required in the type and documentation
    OR
  2. Make it possible to create a role without passing displayName
@alansemenov
Copy link
Member

We won't change Java API (for now, at least), so displayName will have to stay required. We have to fix the TS code though, because displayName is currently nullable there (for users and groups as well). Added a separate task for the docs: enonic/doc-xp#523.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants