<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file except
  ~ in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->

<!-- This file contains the list of permissions that are associated with URL end points
    of the web app. Each permission should contain the name, permission path ,API path
    (URL) , HTTP method and OAUTH2 authorization scope (not-required).
    When defining dynamic paths for APIs, path variables are denoted by '*' notation.
    For ex:
    Actual API endpoint: devicemgt_admin/1.0.0/devices/{device-id}
    URL to be represented here: /devices/*
    NOTE: All the endpoints of the web app should be available in this file. Otherwise
    it will result 403 error at the runtime.
-->
<PermissionConfiguration>
    <APIVersion></APIVersion>
    <!--Permission Tree Name-->
    <Permission>
        <name>Device Management</name>
        <path>/device-mgt</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Admin Permissions -->
    <Permission>
        <name>Device Management Admin</name>
        <path>/device-mgt/admin</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Devices</name>
        <path>/device-mgt/devices</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Device related APIs -->
    <Permission>
        <name>List devices</name>
        <path>/device-mgt/devices/List</path>
        <url>/devices</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Search devices</name>
        <path>/device-mgt/devices/Search</path>
        <url>/devices/search-devices</url>
        <method>POST</method>
    </Permission>
    <Permission>
        <name>View device</name>
        <path>/device-mgt/devices/View</path>
        <url>/devices/*/*</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>View device info</name>
        <path>/device-mgt/devices/View</path>
        <url>/devices/*/*/info</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>View device applications</name>
        <path>/device-mgt/devices/View-Applications</path>
        <url>/devices/*/*/applications</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>View device effective-policy</name>
        <path>/device-mgt/devices/View-Active-Policy</path>
        <url>/devices/*/*/effective-policy</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>View devices feature</name>
        <path>/device-mgt/devices/View-Features</path>
        <url>/devices/*/*/features</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>View device operations</name>
        <path>/device-mgt/devices/View-Operations</path>
        <url>/devices/*/*/operations</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>View Compliance Data</name>
        <path>/device-mgt/devices/View-Compliance-Data</path>
        <url>/devices/*/*/compliance-data</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>List all devices</name>
        <path>/device-mgt/devices/Admin-View</path>
        <url>/admin/devices</url>
        <method>GET</method>
    </Permission>
	<Permission>
		<name>Verify device authorization</name>
		<path>/device-mgt/devices</path>
		<url>/admin/authorization</url>
		<method>POST</method>
	</Permission>
    <Permission>
        <name>View device types</name>
        <path>/device-mgt/devices/Admin-DeviceType-View﻿</path>
        <url>/admin/device-types</url>
        <method>GET</method>
    </Permission>
    <!-- End of Device related APIs -->
    <Permission>
        <name>Policies</name>
        <path>/device-mgt/policies</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Policy related APIs -->
    <Permission>
        <name>List policies</name>
        <path>/device-mgt/policies/List</path>
        <url>/policies</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Add Policy</name>
        <path>/device-mgt/policies/Add</path>
        <url>/policies</url>
        <method>POST</method>
    </Permission>
    <Permission>
        <name>Activate policy</name>
        <path>/device-mgt/policies/Activate-Policy</path>
        <url>/policies/activate-policy</url>
        <method>PUT</method>
    </Permission>
    <Permission>
        <name>Deactivate Policy</name>
        <path>/device-mgt/policies/Deactivate-Policy</path>
        <url>/policies/deactivate-policy</url>
        <method>PUT</method>
    </Permission>
    <Permission>
        <name>Remove Policy</name>
        <path>/device-mgt/policies/Remove</path>
        <url>/policies/remove-policy</url>
        <method>POST</method>
    </Permission>
    <Permission>
        <name>View Policy</name>
        <path>/device-mgt/policies/View</path>
        <url>/policies/*</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Update Policy</name>
        <path>/device-mgt/policies/Update</path>
        <url>/policies/*</url>
        <method>PUT</method>
    </Permission>
    <Permission>
        <name>Update Policy</name>
        <path>/device-mgt/policies/Update</path>
        <url>/policies/apply-changes</url>
        <method>PUT</method>
    </Permission>
    <Permission>
        <name>Update Policy</name>
        <path>/device-mgt/policies/Change-Priority</path>
        <url>/policies/priorities</url>
        <method>PUT</method>
    </Permission>
    <!-- End of Policy related APIs -->
    <Permission>
        <name>Notifications</name>
        <path>/device-mgt/notifications</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Notification related APIs -->
    <Permission>
        <name>View notifications</name>
        <path>/device-mgt/notifications/View</path>
        <url>/notifications</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Mark checked notifications</name>
        <path>/device-mgt/notifications/View</path>
        <url>/notifications/*/mark-checked</url>
        <method>PUT</method>
    </Permission>
    <!-- End of Notification related APIs -->
    <Permission>
        <name>Users</name>
        <path>/device-mgt/users</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- User related APIs -->
    <Permission>
        <name>List users</name>
        <path>/device-mgt/users/List</path>
        <url>/users</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Add user</name>
        <path>/device-mgt/users/Add</path>
        <url>/users</url>
        <method>POST</method>
    </Permission>
    <Permission>
        <name>List users</name>
        <path>/device-mgt/users/Search</path>
        <url>/users/search/usernames</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Remove user</name>
        <path>/device-mgt/users/Remove</path>
        <url>/users/*</url>
        <method>DELETE</method>
    </Permission>
    <Permission>
        <name>View user</name>
        <path>/device-mgt/users/View</path>
        <url>/users/*</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Update user</name>
        <path>/device-mgt/users/Update</path>
        <url>/users/*</url>
        <method>PUT</method>
    </Permission>
    <Permission>
        <name>Update user credentials</name>
        <path>/device-mgt/users/Change-Password</path>
        <url>/users/*/credentials</url>
        <method>PUT</method>
    </Permission>
    <Permission>
        <name>View assigned role</name>
        <path>/device-mgt/roles/Assigned-Roles</path>
        <url>/users/*/roles</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Change any user credentials</name>
        <path>/device-mgt/users/Change-Password-Any</path>
        <url>/admin/users/*/credentials</url>
        <method>POST</method>
    </Permission>
    <Permission>
        <name>Send invitation mail</name>
        <path>/device-mgt/users/Send-invitations</path>
        <url>/users/send-invitation</url>
        <method>POST</method>
    </Permission>
    <!-- End of User related APIs -->
    <Permission>
        <name>Roles</name>
        <path>/device-mgt/roles</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Role related APIs -->
    <Permission>
        <name>List roles</name>
        <path>/device-mgt/roles/List</path>
        <url>/roles</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Add role</name>
        <path>/device-mgt/roles/Add</path>
        <url>/roles</url>
        <method>POST</method>
    </Permission>
    <Permission>
        <name>Remove role</name>
        <path>/device-mgt/roles/Remove</path>
        <url>/roles/*</url>
        <method>DELETE</method>
    </Permission>
    <Permission>
        <name>View role</name>
        <path>/device-mgt/roles/View</path>
        <url>/roles/*</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Update role</name>
        <path>/device-mgt/roles/Update</path>
        <url>/roles/*</url>
        <method>PUT</method>
    </Permission>
    <Permission>
        <name>View role permissions</name>
        <path>/device-mgt/roles/View-Permission</path>
        <url>/roles/*/permissions</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Add Users to role</name>
        <path>/device-mgt/roles/Add-Users</path>
        <url>/roles/*/users</url>
        <method>PUT</method>
    </Permission>
    <!-- End of Role related APIs -->
    <Permission>
        <name>Configurations</name>
        <path>/device-mgt/general-configs</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Configuration related APIs -->
    <Permission>
        <name>View configuration</name>
        <path>/device-mgt/general-configuration/View</path>
        <url>/configuration</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>Update configuration</name>
        <path>/device-mgt/general-configuration/Update</path>
        <url>/configuration</url>
        <method>PUT</method>
    </Permission>
    <!-- End of Configuration related APIs -->
    <Permission>
        <name>Activities</name>
        <path>/device-mgt/activities</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Activity related APIs -->
    <Permission>
        <name>View Activities</name>
        <path>/device-mgt/devices/owning/view</path>
        <url>/activities</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>View Activity Details</name>
        <path>/device-mgt/devices/owning/view</path>
        <url>/activities/*</url>
        <method>GET</method>
    </Permission>
    <!-- End of Activity related APIs -->
    <Permission>
        <name>Applications</name>
        <path>/device-mgt/applications</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- Application related APIs -->
    <Permission>
        <name>Install Applications</name>
        <path>/device-mgt/application/Install</path>
        <url>/admin/applications/install-application</url>
        <method>POST</method>
    </Permission>
    <Permission>
        <name>Uninstall-Applications</name>
        <path>/device-mgt/application/Uninstall</path>
        <url>/admin/applications/uninstall-application</url>
        <method>POST</method>
    </Permission>
    <!-- End of Application related APIs -->
    <!-- End of Admin Permissions -->
    <!-- User Permissions -->
    <Permission>
        <name>Device Management User</name>
        <path>/device-mgt/user</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>User Devices</name>
        <path>/device-mgt/user/devices</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>User Policies</name>
        <path>/device-mgt/user/policies</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>User Notifications</name>
        <path>/device-mgt/user/notifications</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <Permission>
        <name>User Operations</name>
        <path>/device-mgt/user/operations</path>
        <url>/</url>
        <method>GET</method>
    </Permission>
    <!-- End of User Permissions -->
    <!--End of Permission Tree-->
</PermissionConfiguration>
