v1.0.0
This commit is contained in:
@@ -5,7 +5,7 @@ class ApartmentsController {
|
||||
const { entrance_id } = req.params;
|
||||
|
||||
if (entrance_id) {
|
||||
if (req.sheepRole == "administrator" || (req.sheepRole == "moderator" && req.moderator.can_manager_territory) || req.can_view_territory) {
|
||||
if (req.possibilities.can_view_territory) {
|
||||
let result = await ApartmentsService.getApartments(entrance_id);
|
||||
if (result) {
|
||||
return res
|
||||
@@ -33,7 +33,7 @@ class ApartmentsController {
|
||||
const data = req.body;
|
||||
|
||||
if (entrance_id && data) {
|
||||
if (req.sheepRole == "administrator" || req.moderator.can_add_territory) {
|
||||
if (req.possibilities.can_add_territory) {
|
||||
let result = await ApartmentsService.createApartments(
|
||||
entrance_id,
|
||||
data
|
||||
@@ -62,7 +62,7 @@ class ApartmentsController {
|
||||
const data = req.body;
|
||||
|
||||
if (data) {
|
||||
if (req.sheepRole == "administrator" || req.moderator.can_add_territory) {
|
||||
if (req.possibilities.can_add_territory) {
|
||||
let result = await ApartmentsService.updateApartments(data);
|
||||
if (result) {
|
||||
return res.status(200).send(result);
|
||||
@@ -87,7 +87,7 @@ class ApartmentsController {
|
||||
const data = req.body;
|
||||
|
||||
if (data) {
|
||||
if (req.sheepRole == "administrator" || req.moderator.can_add_territory) {
|
||||
if (req.possibilities.can_add_territory) {
|
||||
let result = await ApartmentsService.deleteApartments(data);
|
||||
if (result) {
|
||||
return res.status(200).send(result);
|
||||
|
||||
Reference in New Issue
Block a user