LibreOffice Module stoc (master) 1
permissions.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_STOC_SOURCE_SECURITY_PERMISSIONS_H
20#define INCLUDED_STOC_SOURCE_SECURITY_PERMISSIONS_H
21
22#include <rtl/ref.hxx>
23#include <rtl/ustring.hxx>
25#include <utility>
26
27namespace com::sun::star::uno { class Any; }
28namespace com::sun::star::uno { template <class E> class Sequence; }
29
30namespace stoc_sec
31{
32
34{
35public:
37 // mode
39
41 t_type type,
43 : m_next(std::move( next ))
44 , m_type( type )
45 {}
46
47 virtual bool implies( Permission const & perm ) const = 0;
48 virtual OUString toString() const = 0;
49};
50
52{
53public:
54 explicit AllPermission(
56 : Permission( ALL, next )
57 {}
58
59 virtual bool implies( Permission const & ) const override;
60 virtual OUString toString() const override;
61};
62
63
65{
67public:
69 {}
71 : m_head(std::move( single ))
72 {}
74 css::uno::Sequence< css::uno::Any > const & permissions,
75 PermissionCollection const & addition = PermissionCollection() );
76#ifdef __DIAGNOSE
77 css::uno::Sequence< OUString > toStrings() const;
78#endif
79 void checkPermission( css::uno::Any const & perm ) const;
80};
81
82}
83
84#endif
85
86/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AllPermission(::rtl::Reference< Permission > const &next=::rtl::Reference< Permission >())
Definition: permissions.h:54
virtual OUString toString() const override
virtual bool implies(Permission const &) const override
PermissionCollection(css::uno::Sequence< css::uno::Any > const &permissions, PermissionCollection const &addition=PermissionCollection())
PermissionCollection(::rtl::Reference< Permission > single)
Definition: permissions.h:70
void checkPermission(css::uno::Any const &perm) const
::rtl::Reference< Permission > m_head
Definition: permissions.h:66
virtual bool implies(Permission const &perm) const =0
virtual OUString toString() const =0
::rtl::Reference< Permission > m_next
Definition: permissions.h:36
enum stoc_sec::Permission::t_type m_type
Permission(t_type type, ::rtl::Reference< Permission > next)
Definition: permissions.h:40
ResultType type