|
@@ -984,7 +984,7 @@ class _StationsModule extends CoreClass {
|
|
|
* @param {object} payload - object that contains the payload
|
|
|
* @param {object} payload.station - the station object of the station in question
|
|
|
* @param {string} payload.userId - the id of the user in question
|
|
|
- * @param {boolean} payload.hideUnlisted - whether the user is allowed to see unlisted stations or not
|
|
|
+ * @param {boolean} payload.homeView - whether to modify output for homepage usage
|
|
|
* @returns {Promise} - returns a promise (resolve, reject)
|
|
|
*/
|
|
|
CAN_USER_VIEW_STATION(payload) {
|
|
@@ -993,9 +993,7 @@ class _StationsModule extends CoreClass {
|
|
|
[
|
|
|
next => {
|
|
|
if (payload.station.privacy === "public") return next(true);
|
|
|
- if (payload.station.privacy === "unlisted")
|
|
|
- if (payload.hideUnlisted === true) return next();
|
|
|
- else return next(true);
|
|
|
+ if (payload.station.privacy === "unlisted" && !payload.homeView) return next(true);
|
|
|
if (!payload.userId) return next("Not allowed");
|
|
|
|
|
|
return next();
|
|
@@ -1009,7 +1007,7 @@ class _StationsModule extends CoreClass {
|
|
|
|
|
|
(user, next) => {
|
|
|
if (!user) return next("Not allowed");
|
|
|
- if (user.role === "admin") return next(true);
|
|
|
+ if (!payload.homeView && user.role === "admin") return next(true);
|
|
|
if (payload.station.type === "official") return next("Not allowed");
|
|
|
if (payload.station.owner === payload.userId) return next(true);
|
|
|
|