mirror of
https://github.com/discourse/discourse.git
synced 2025-02-04 08:05:15 +08:00
22 lines
444 B
JavaScript
22 lines
444 B
JavaScript
import Group from 'discourse/models/group';
|
|
|
|
export default Discourse.Route.extend({
|
|
titleToken() {
|
|
return I18n.t('admin.groups.new.title');
|
|
},
|
|
|
|
model() {
|
|
return Group.create({ automatic: false, visibility_level: 0 });
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
controller.set("model", model);
|
|
},
|
|
|
|
afterModel() {
|
|
if (!(this.currentUser && this.currentUser.admin)) {
|
|
this.transitionTo("groups");
|
|
}
|
|
},
|
|
});
|