Please try now.
I'm not sure if this is exactly what OP needs though. It adds a permission for a user to create a group and assign it to a category. Not exactly the same thing as approval.
I was able to add user field on user creation by using hook filter:user.create. Now I noticed that the field is not generally available on the profile and to make it available we need to use the filter:user.whitelistFields . Please correct me if I am wrong.
Now if I add my field to the whitelist I noticed that the field gets exposed to everybody. How can I make this field only available to the owner or admin?
Thanks!
If you only want to make it available on the profile page you can use the filter:account/profile.build
hook and load the value from db and set it the user is self or admin.
All the required data should be passed to the build hook.
userData.isAdmin = isAdmin;
userData.isGlobalModerator = isGlobalModerator;
userData.isModerator = isModerator;
userData.isAdminOrGlobalModerator = isAdmin || isGlobalModerator;
userData.isAdminOrGlobalModeratorOrModerator = isAdmin || isGlobalModerator || isModerator;
userData.isSelfOrAdminOrGlobalModerator = isSelf || isAdmin || isGlobalModerator;
userData.isSelf = isSelf;
@baris said in how to hide whitelist user field only to owner or admin?:
ad the value from db and set it the user is self or admin.
perfect. Thanks!