2017-08-22 10:53:26 +03:00
|
|
|
import Mixin from '@ember/object/mixin';
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
export default Mixin.create({
|
|
|
|
transitionAuthor() {
|
|
|
|
return (user) => {
|
2018-02-07 12:42:46 +03:00
|
|
|
if (user.get('isAuthorOrContributor')) {
|
2019-02-22 12:43:35 +03:00
|
|
|
return this.transitionTo('staff.user', user);
|
2014-10-25 01:09:50 +04:00
|
|
|
}
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
return user;
|
|
|
|
};
|
|
|
|
},
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
transitionEditor() {
|
|
|
|
return (user) => {
|
2014-10-25 01:09:50 +04:00
|
|
|
if (user.get('isEditor')) {
|
2019-02-22 12:43:35 +03:00
|
|
|
return this.transitionTo('staff');
|
2014-10-25 01:09:50 +04:00
|
|
|
}
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
return user;
|
|
|
|
};
|
|
|
|
}
|
2014-07-25 11:52:17 +04:00
|
|
|
});
|