Add smackfs check to Installer service.
[platform/core/security/security-manager.git] / src / server / service / app-permissions.h
1 /*
2  *  Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Contact: Bartlomiej Grzelewski <b.grzelewski@samsung.com>
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License
17  */
18 /*
19  * @file        app-permissions.h
20  * @author      Pawel Polawski (p.polawski@partner.samsung.com)
21  * @version     1.0
22  * @brief       This function contains header for implementation of
23  *              security_server_app_has_permissions on server side
24  */
25
26 #ifndef _SECURITY_SERVER_APP_PERMISSIONS_
27 #define _SECURITY_SERVER_APP_PERMISSIONS_
28
29 #include <service-thread.h>
30 #include <generic-socket-manager.h>
31 #include <dpl/serialization.h>
32 #include <message-buffer.h>
33 #include <connection-info.h>
34
35 namespace SecurityServer {
36
37 class AppPermissionsService  :
38     public SecurityServer::GenericSocketService
39   , public SecurityServer::ServiceThread<AppPermissionsService>
40 {
41 public:
42     ServiceDescriptionVector GetServiceDescription();
43
44     DECLARE_THREAD_EVENT(AcceptEvent, accept)
45     DECLARE_THREAD_EVENT(WriteEvent, write)
46     DECLARE_THREAD_EVENT(ReadEvent, process)
47     DECLARE_THREAD_EVENT(CloseEvent, close)
48
49     void accept(const AcceptEvent &event);
50     void write(const WriteEvent &event);
51     void process(const ReadEvent &event);
52     void close(const CloseEvent &event);
53
54 private:
55     bool processOne(const ConnectionID &conn, MessageBuffer &buffer, InterfaceID interfaceID);
56
57     bool processCheckAppPrivilege(const ConnectionID &conn, MessageBuffer &buffer);
58
59     ConnectionInfoMap m_connectionInfoMap;
60 };
61
62 } // namespace SecurityServer
63
64 #endif // _SECURITY_SERVER_APP_ENABLE_PERMISSIONS_