Installazioni e rimozione di luci per eventi: come trovare elettricisti
Come Trovare Elettricisti per Installare e Rimuovere Luci per Eventi
Come Assumere Elettricisti per Installare e Rimuovere Luci per Eventi.
Scopri come trovare i migliori elettricisti per installare e rimuovere luci per eventi. Questo articolo offre suggerimenti utili su come selezionare professionisti qualificati, considerando fattori come esperienza, recensioni e costi. Non lasciare nulla al caso per il tuo evento!
Trova professionisti vicino a te
Trova professionisti
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.jackrabbit.oak.security.authorization.permission;
import java.util.Map;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.ConfigurationPolicy;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.PropertyUnbounded;
import org.apache.jackrabbit.oak.api.ContentRepository;
import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
import org.apache.jackrabbit.oak.spi.security.authorization.AuthorizationConfiguration;
import org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider;
import org.apache.jackrabbit.oak.spi.security.authorization.permission.Permissions;
import org.apache.jackrabbit.oak.spi.security.authorization.permission.TreePermission;
import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
import org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardAware;
import org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils;
import org.osgi.service.component.ComponentContext;
/**
* PermissionProvider implementation based on the configured
* {@link org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AccessControlManager}.
*/
@Component(
// to make sure the configuration is applied before the repository is
// initialized.
configurationFactory = true,
policy = ConfigurationPolicy.REQUIRE,
metatype = true,
label = "Apache Jackrabbit Oak PermissionProvider")
public class PermissionProviderImpl implements AuthorizationConfiguration, WhiteboardAware {
@Property(
label = "Paths",
description = "Paths that should be excluded from access control evaluation.",
unbounded = PropertyUnbounded.ARRAY)
private static final String PARAM_EXCLUDED_PATHS = "excludedPaths";
private final PermissionProvider permissionProvider;
private final PermissionHook hook;
private Whiteboard whiteboard;
public PermissionProviderImpl() {
permissionProvider = new PermissionProviderImpl.DefaultPermissionProvider();
hook = new PermissionHook(permissionProvider);
}
@Activate
private void activate(ComponentContext context, Map properties) {
ConfigurationParameters config = ConfigurationParameters.of(properties);
PermissionHook.ExcludedPaths excludedPaths = new PermissionHook.ExcludedPaths();
for (String path : config.getConfigValue(PARAM_EXCLUDED_PATHS, new String[0])) {
excludedPaths.addExcludedPath(path);
}
hook.setExcludedPaths(excludedPaths);
if (whiteboard != null) {
whiteboard.register(PermissionHook.class, hook, config.getConfigValue("name", new ConfigurationParameters.PropertyBuilder("PermissionHook")).asValueMap());
}
}
@Deactivate
private void deactivate(ComponentContext context) {
if (whiteboard != null) {
WhiteboardUtils.unregisterServices(whiteboard, PermissionHook.class);
}
}
//----------------------------------------------------------< WhiteboardAware >---
@Override
public void setWhiteboard(Whiteboard whiteboard) {
this.whiteboard = whiteboard;
}
//-------------------------------------------< AuthorizationConfiguration >---
@Override
public void setSecurityProvider(SecurityProvider securityProvider) {
// ignore
}
@Override
public void setContentRepository(ContentRepository contentRepository) {
// ignore
}
@Override
public void init() {
// ignore
}
@Override
public void afterWorkspaceCreated(String workspaceName) {
// ignore
}
@Override
public void afterWorkspaceRemoved(String workspaceName) {
// ignore
}
@Override
public void close() {
// ignore
}
@Override
public PermissionProvider getPermissionProvider(String workspaceName) {
return permissionProvider;
}
private static final class DefaultPermissionProvider implements PermissionProvider {
@Override
public void refresh() {
// nothing to do
}
@Override
public void close() {
// nothing to do
}
@Override
public boolean isGranted(long permissions) {
return Permissions.includes(permissions, Permissions.READ_NODE);
}
@Override
public boolean isGranted(String oakPath, long permissions) {
return Permissions.includes(permissions, Permissions.READ_NODE);
}
@Override
public TreePermission getTreePermission(String oakPath, TreePermission parentPermission) {
return TreePermission.EMPTY;
}
}
}