mirror of
https://github.com/discourse/discourse.git
synced 2024-12-11 16:45:47 +08:00
845170bd6b
There are 4 visibility levels - public (default) - members only - staff - owners Note, admins and group owners ALWAYS have visibility to groups Migration treated old "non public" as "members only"
25 lines
581 B
JavaScript
25 lines
581 B
JavaScript
import Group from 'discourse/models/group';
|
|
|
|
export default Discourse.Route.extend({
|
|
|
|
model(params) {
|
|
if (params.name === 'new') {
|
|
return Group.create({ automatic: false, visibility_level: 0 });
|
|
}
|
|
|
|
const group = this.modelFor('adminGroupsType').findBy('name', params.name);
|
|
|
|
if (!group) { return this.transitionTo('adminGroups.index'); }
|
|
|
|
return group;
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
controller.set("model", model);
|
|
controller.set("model.usernames", null);
|
|
controller.set("savingStatus", "");
|
|
model.findMembers();
|
|
}
|
|
|
|
});
|