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

Remove Delete Account Button for Standard Users #845

Closed
teenwolf99 opened this issue Jan 22, 2025 · 1 comment
Closed

Remove Delete Account Button for Standard Users #845

teenwolf99 opened this issue Jan 22, 2025 · 1 comment

Comments

@teenwolf99
Copy link

@jhuckaby, If possible please remove the Delete Account button for the standard users under My Account tab. So that non-admin users can't delete their own accounts.

Image Image

Once Delete button is clicked the user is deleted.

@jhuckaby
Copy link
Owner

Added in Cronicle v0.9.69 which was just released. Click here for upgrade instructions.

You can now include a self_delete property in your /opt/cronicle/conf/config.json file, specifically inside the User object, and set this to false. This will disable the ability for users to delete their own account from the My Account page. Example User config section with new prop added:

"User": {
	"session_expire_days": 30,
	"max_failed_logins_per_hour": 5,
	"max_forgot_passwords_per_hour": 3,
	"free_accounts": false,
	"sort_global_users": true,
	"use_bcrypt": true,

	"self_delete": false,
	
	"email_templates": {
		"welcome_new_user": "conf/emails/welcome_new_user.txt",
		"changed_password": "conf/emails/changed_password.txt",
		"recover_password": "conf/emails/recover_password.txt"
	},
	
	"default_privileges": {
		"admin": 0,
		"create_events": 1,
		"edit_events": 1,
		"delete_events": 1,
		"run_events": 0,
		"abort_events": 0,
		"state_update": 0
	}
}

The button will still be visible in the UI, but the operation will fail with an error message:

Image

Administrators can still delete accounts (including their own) from the Admin/Users page. Just not from the "My Account" page.

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

No branches or pull requests

2 participants