function checkLayerAndUserAuthorization(sLayer, sActiveLayer, sUserId) {
		if (sActiveLayer) {
			return sLayer === sActiveLayer;
		} else if (sLayer === Layer.USER) {
			return true;
		}
		var oSettings = Settings.getInstanceOrUndef();

		if (LayerUtils.isSapUiLayerParameterProvided()) {
			sActiveLayer = LayerUtils.getCurrentLayer();
		} else {sActiveLayer ||= oSettings.getIsPublicLayerAvailable() ? Layer.PUBLIC : Layer.CUSTOMER;}
		var bLayerWritable = sLayer === sActiveLayer;
		var bUserAuthorized = oSettings.getIsKeyUser() || isUserAuthor(sUserId);

		return bLayerWritable && bUserAuthorized;
	}
Checks if the the variant can be modified due to its layer and the user's authorization.
@param {sap.ui.fl.Layer} sLayer - Layer of the variant
@param {sap.ui.fl.Layer} [sActiveLayer] - Layer in which the operation may take place
@param {string} sUserId - ID of the variants creator
@returns {boolean} <code>true</code> if the variant is read only