Search in sources :

Example 6 with AppPermission

use of org.onosproject.security.AppPermission in project onos by opennetworkinglab.

the class DefaultPolicyBuilder method convertToJavaPermissions.

public static List<Permission> convertToJavaPermissions(Set<org.onosproject.security.Permission> permissions) {
    List<Permission> result = Lists.newArrayList();
    for (org.onosproject.security.Permission perm : permissions) {
        Permission javaPerm = getPermission(perm);
        if (javaPerm != null) {
            if (javaPerm instanceof AppPermission) {
                if (((AppPermission) javaPerm).getType() != null) {
                    AppPermission ap = (AppPermission) javaPerm;
                    result.add(ap);
                    if (serviceDirectory.containsKey(ap.getType())) {
                        for (String service : serviceDirectory.get(ap.getType())) {
                            result.add(new ServicePermission(service, ServicePermission.GET));
                        }
                    }
                }
            } else if (javaPerm instanceof ServicePermission) {
                if (!javaPerm.getName().contains(SecurityAdminService.class.getName())) {
                    result.add(javaPerm);
                }
            } else {
                result.add(javaPerm);
            }
        }
    }
    return result;
}
Also used : AppPermission(org.onosproject.security.AppPermission) SecurityAdminService(org.onosproject.security.SecurityAdminService) ServicePermission(org.osgi.framework.ServicePermission) PropertyPermission(java.util.PropertyPermission) FilePermission(java.io.FilePermission) AudioPermission(javax.sound.sampled.AudioPermission) SocketPermission(java.net.SocketPermission) ReflectPermission(java.lang.reflect.ReflectPermission) SSLPermission(javax.net.ssl.SSLPermission) Permission(java.security.Permission) ConfigurationPermission(org.osgi.service.cm.ConfigurationPermission) DelegationPermission(javax.security.auth.kerberos.DelegationPermission) CapabilityPermission(org.osgi.framework.CapabilityPermission) SerializablePermission(java.io.SerializablePermission) PackagePermission(org.osgi.framework.PackagePermission) NetPermission(java.net.NetPermission) AdminPermission(org.osgi.framework.AdminPermission) BundlePermission(org.osgi.framework.BundlePermission) PrivateCredentialPermission(javax.security.auth.PrivateCredentialPermission) SQLPermission(java.sql.SQLPermission) AppPermission(org.onosproject.security.AppPermission) LoggingPermission(java.util.logging.LoggingPermission) ServicePermission(org.osgi.framework.ServicePermission) AdaptPermission(org.osgi.framework.AdaptPermission) AuthPermission(javax.security.auth.AuthPermission)

Aggregations

AppPermission (org.onosproject.security.AppPermission)6 AdaptPermission (org.osgi.framework.AdaptPermission)6 AdminPermission (org.osgi.framework.AdminPermission)6 PackagePermission (org.osgi.framework.PackagePermission)6 ServicePermission (org.osgi.framework.ServicePermission)6 Permission (java.security.Permission)5 ConfigurationPermission (org.osgi.service.cm.ConfigurationPermission)5 FilePermission (java.io.FilePermission)3 SerializablePermission (java.io.SerializablePermission)3 ReflectPermission (java.lang.reflect.ReflectPermission)3 NetPermission (java.net.NetPermission)3 SocketPermission (java.net.SocketPermission)3 SQLPermission (java.sql.SQLPermission)3 PropertyPermission (java.util.PropertyPermission)3 LoggingPermission (java.util.logging.LoggingPermission)3 SSLPermission (javax.net.ssl.SSLPermission)3 AuthPermission (javax.security.auth.AuthPermission)3 PrivateCredentialPermission (javax.security.auth.PrivateCredentialPermission)3 DelegationPermission (javax.security.auth.kerberos.DelegationPermission)3 AudioPermission (javax.sound.sampled.AudioPermission)3