示例#1
0
# Copyright (c) 2016 "Capensis" [http://www.capensis.com]
#
# This file is part of Canopsis.
#
# Canopsis is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Canopsis is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Canopsis.  If not, see <http://www.gnu.org/licenses/>.
# ---------------------------------

from canopsis.common.ws import route
from canopsis.check.manager import CheckManager
from canopsis.webcore.services.rest import delete_records

manager = CheckManager()


def exports(ws):
    @route(ws.application.delete, name='userview', payload=[])
    def remove_elements(_id, **kwargs):
        delete_records(ws, 'default_rights', 'action', _id, None)
        return delete_records(ws, 'object', 'view', _id, None)
示例#2
0
 def setUp(self):
     self.manager = CheckManager()