Search in sources :

Example 1 with CapabilityPermission

use of org.osgi.framework.CapabilityPermission in project onos by opennetworkinglab.

the class DefaultPolicyBuilder method getPermission.

private static Permission getPermission(org.onosproject.security.Permission permission) {
    String classname = permission.getClassName();
    String name = permission.getName();
    String actions = permission.getActions();
    if (classname == null || name == null) {
        return null;
    }
    classname = classname.trim();
    name = name.trim();
    actions = actions.trim();
    if (AppPermission.class.getName().equals(classname)) {
        return new AppPermission(name);
    } else if (FilePermission.class.getName().equals(classname)) {
        return new FilePermission(name, actions);
    } else if (SerializablePermission.class.getName().equals(classname)) {
        return new SerializablePermission(name, actions);
    } else if (NetPermission.class.getName().equals(classname)) {
        return new NetPermission(name, actions);
    } else if (RuntimePermission.class.getName().equals(classname)) {
        return new RuntimePermission(name, actions);
    } else if (SocketPermission.class.getName().equals(classname)) {
        return new SocketPermission(name, actions);
    } else if (SQLPermission.class.getName().equals(classname)) {
        return new SQLPermission(name, actions);
    } else if (PropertyPermission.class.getName().equals(classname)) {
        return new PropertyPermission(name, actions);
    } else if (LoggingPermission.class.getName().equals(classname)) {
        return new LoggingPermission(name, actions);
    } else if (SSLPermission.class.getName().equals(classname)) {
        return new SSLPermission(name, actions);
    } else if (AuthPermission.class.getName().equals(classname)) {
        return new AuthPermission(name, actions);
    } else if (PrivateCredentialPermission.class.getName().equals(classname)) {
        return new PrivateCredentialPermission(name, actions);
    } else if (DelegationPermission.class.getName().equals(classname)) {
        return new DelegationPermission(name, actions);
    } else if (javax.security.auth.kerberos.ServicePermission.class.getName().equals(classname)) {
        return new javax.security.auth.kerberos.ServicePermission(name, actions);
    } else if (AudioPermission.class.getName().equals(classname)) {
        return new AudioPermission(name, actions);
    } else if (AdaptPermission.class.getName().equals(classname)) {
        return new AdaptPermission(name, actions);
    } else if (BundlePermission.class.getName().equals(classname)) {
        return new BundlePermission(name, actions);
    } else if (CapabilityPermission.class.getName().equals(classname)) {
        return new CapabilityPermission(name, actions);
    } else if (PackagePermission.class.getName().equals(classname)) {
        return new PackagePermission(name, actions);
    } else if (ServicePermission.class.getName().equals(classname)) {
        return new ServicePermission(name, actions);
    } else if (AdminPermission.class.getName().equals(classname)) {
        return new AdminPermission(name, actions);
    // } else if (ConfigurationPermission.class.getName().equals(classname)) {
    // return new ConfigurationPermission(name, actions);
    } else if (ReflectPermission.class.getName().equals(classname)) {
        return new ReflectPermission(name, actions);
    }
    // AWTPermission,  ReflectPermission not allowed
    return null;
}
Also used : PropertyPermission(java.util.PropertyPermission) FilePermission(java.io.FilePermission) SQLPermission(java.sql.SQLPermission) BundlePermission(org.osgi.framework.BundlePermission) LoggingPermission(java.util.logging.LoggingPermission) AudioPermission(javax.sound.sampled.AudioPermission) SerializablePermission(java.io.SerializablePermission) PrivateCredentialPermission(javax.security.auth.PrivateCredentialPermission) AdminPermission(org.osgi.framework.AdminPermission) AuthPermission(javax.security.auth.AuthPermission) SocketPermission(java.net.SocketPermission) CapabilityPermission(org.osgi.framework.CapabilityPermission) SSLPermission(javax.net.ssl.SSLPermission) PackagePermission(org.osgi.framework.PackagePermission) DelegationPermission(javax.security.auth.kerberos.DelegationPermission) AppPermission(org.onosproject.security.AppPermission) NetPermission(java.net.NetPermission) ServicePermission(org.osgi.framework.ServicePermission) ReflectPermission(java.lang.reflect.ReflectPermission) AdaptPermission(org.osgi.framework.AdaptPermission)

Aggregations

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