anteo / redmine_custom_workflows

Allows to create custom workflows for Redmine
http://www.redmine.org/plugins/custom-workflows
GNU General Public License v2.0
178 stars 72 forks source link

Remove user from groups when locked #343

Closed marmat1 closed 2 weeks ago

marmat1 commented 1 month ago

I would like to remove users from their groups when they are locked.

I have tried with an user after saving observable object workflow:

if (self.locked?)
  self.groups.remove
end

Is there any method in user or group classes to get it?

Many thanks.

picman commented 3 weeks ago
if locked?
  groups.delete_all
end
marmat1 commented 2 weeks ago

Perfect! It works!

if self.locked? self.groups.delete_all end