Added search definition to role, bugfix when storing role permissions